diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2024-08-06 19:06:42 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2024-08-06 19:06:42 +0800 |
commit | 16a7c65b0284d4b8ae40b2d1c75d898c08771b34 (patch) | |
tree | 7088415e7052d76fdda8d573b2c389035cf88c9d | |
parent | 26a7b690c7eeb1a209b1b600886b2ac6691c5d2e (diff) | |
download | lua-language-server-16a7c65b0284d4b8ae40b2d1c75d898c08771b34.zip |
fix wront indentation in some case
#2786
-rw-r--r-- | script/core/fix-indent.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/script/core/fix-indent.lua b/script/core/fix-indent.lua index 8513c4a8..c0aaeee1 100644 --- a/script/core/fix-indent.lua +++ b/script/core/fix-indent.lua @@ -138,7 +138,8 @@ local function fixWrongIndent(state, change) return end - local endOffset = guide.positionToOffset(state, position) + #change.text + local endPosition = guide.positionOf(change.range.start.line + 1, #myIndent) + local endOffset = guide.positionToOffset(state, endPosition) local edits = {} edits[#edits+1] = { |