From 76b3927c1c4574a64d3e56368753e429a912de75 Mon Sep 17 00:00:00 2001 From: NeOzay Date: Fri, 6 Sep 2024 17:32:36 +0200 Subject: fix autocompletion --- script/core/completion/completion.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index 866d6590..43b5d5ce 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -78,7 +78,9 @@ local function findNearestSource(state, position) ---@type parser.object local source guide.eachSourceContain(state.ast, position, function (src) - source = src + if not source or source.start <= src.start then + source = src + end end) return source end -- cgit v1.2.3