summaryrefslogtreecommitdiff
path: root/script/provider/provider.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/provider/provider.lua')
-rw-r--r--script/provider/provider.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 923b6c1f..74ee11db 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -191,7 +191,9 @@ proto.on('textDocument/didChange', function (params)
local text = files.getOriginText(uri) or ''
for _, change in ipairs(changes) do
if change.range then
- local start, finish = files.unrange(uri, change.range)
+ local start, finish = files.unrange(uri, change.range, true)
+ start = files.diffedOffsetBack(uri, start)
+ finish = files.diffedOffsetBack(uri, finish)
text = text:sub(1, start) .. change.text .. text:sub(finish + 1)
else
text = change.text