Skip to content

Commit 76b3927

Browse files
committed
fix autocompletion
1 parent c9d8193 commit 76b3927

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

script/core/completion/completion.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ local function findNearestSource(state, position)
7878
---@type parser.object
7979
local source
8080
guide.eachSourceContain(state.ast, position, function (src)
81-
source = src
81+
if not source or source.start <= src.start then
82+
source = src
83+
end
8284
end)
8385
return source
8486
end

0 commit comments

Comments
 (0)