summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/core/completion.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/script/core/completion.lua b/script/core/completion.lua
index a8500b09..8b1cbcf2 100644
--- a/script/core/completion.lua
+++ b/script/core/completion.lua
@@ -1709,6 +1709,7 @@ local function makeCache(uri, offset, results)
cache.results = results
cache.offset = offset
cache.word = word:lower()
+ cache.length = #word
end
local function getCache(uri, offset)
@@ -1725,6 +1726,14 @@ local function getCache(uri, offset)
return nil
end
+ local ext = #word - cache.length
+ cache.length = #word
+ for _, result in ipairs(cache.results) do
+ if result.textEdit then
+ result.textEdit.finish = result.textEdit.finish + ext
+ end
+ end
+
if cache.results.enableCommon then
local results = cache.results
for i = #results, 1, -1 do