File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -122,18 +122,19 @@ local function fixWrongIndent(state, change)
122
122
local position = guide .positionOf (change .range .start .line , change .range .start .character )
123
123
local row = guide .rowColOf (position )
124
124
local myIndent = getIndent (state , row + 1 )
125
- local lastIndent = getIndent (state , row )
126
- if # myIndent <= # lastIndent then
125
+ local lastOffset = lookBackward . findAnyOffset (state . lua , guide . positionToOffset ( state , position ) )
126
+ if not lastOffset then
127
127
return
128
128
end
129
- if not util .stringStartWith (myIndent , lastIndent ) then
129
+ local lastPosition = guide .offsetToPosition (state , lastOffset )
130
+ local lastRow = guide .rowColOf (lastPosition )
131
+ local lastIndent = getIndent (state , lastRow )
132
+ if # myIndent <= # lastIndent then
130
133
return
131
134
end
132
- local lastOffset = lookBackward .findAnyOffset (state .lua , guide .positionToOffset (state , position ))
133
- if not lastOffset then
135
+ if not util .stringStartWith (myIndent , lastIndent ) then
134
136
return
135
137
end
136
- local lastPosition = guide .offsetToPosition (state , lastOffset )
137
138
if isInBlock (state , lastPosition ) then
138
139
return
139
140
end
You can’t perform that action at this time.
0 commit comments