Skip to content

Commit 48f5977

Browse files
committed
show relative path in completion
1 parent 37b5f6c commit 48f5977

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

script/core/completion/completion.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ local function collectRequireNames(mode, myUri, literal, source, smark, position
886886
end
887887
local path = furi.decode(uri)
888888
local infos = rpath.getVisiblePath(uri, path)
889+
local relative = workspace.getRelativePath(path)
889890
for _, info in ipairs(infos) do
890891
if matchKey(literal, info.expect) then
891892
if not collect[info.expect] then
@@ -895,14 +896,14 @@ local function collectRequireNames(mode, myUri, literal, source, smark, position
895896
finish = smark and (source.finish - #smark) or position,
896897
newText = smark and info.expect or util.viewString(info.expect),
897898
},
898-
path = path,
899+
path = relative,
899900
}
900901
end
901902
if vm.isMetaFile(uri) then
902903
collect[info.expect][#collect[info.expect]+1] = ('* [[meta]](%s)'):format(uri)
903904
else
904905
collect[info.expect][#collect[info.expect]+1] = ([=[* [%s](%s) %s]=]):format(
905-
path,
906+
relative,
906907
uri,
907908
lang.script('HOVER_USE_LUA_PATH', info.searcher)
908909
)

0 commit comments

Comments
 (0)