Skip to content

Commit 16a7c65

Browse files
committed
fix wront indentation in some case
#2786
1 parent 26a7b69 commit 16a7c65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

script/core/fix-indent.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ local function fixWrongIndent(state, change)
138138
return
139139
end
140140

141-
local endOffset = guide.positionToOffset(state, position) + #change.text
141+
local endPosition = guide.positionOf(change.range.start.line + 1, #myIndent)
142+
local endOffset = guide.positionToOffset(state, endPosition)
142143

143144
local edits = {}
144145
edits[#edits+1] = {

0 commit comments

Comments
 (0)