@@ -3,6 +3,7 @@ local guide = require 'parser.guide'
3
3
local proto = require ' proto.proto'
4
4
local lookBackward = require ' core.look-backward'
5
5
local util = require ' utility'
6
+ local client = require ' client'
6
7
7
8
--- @param state parser.state
8
9
--- @param change table
@@ -114,7 +115,7 @@ local function isInBlock(state, position)
114
115
return block ~= nil
115
116
end
116
117
117
- local function fixWrongIdent (state , change )
118
+ local function fixWrongIndent (state , change )
118
119
if not change .text :match ' ^\r ?\n [\t ]+$' then
119
120
return false
120
121
end
@@ -189,6 +190,9 @@ local function applyEdits(state, edits)
189
190
end
190
191
191
192
return function (uri , changes )
193
+ if not client .getOption (' fixIndents' ) then
194
+ return
195
+ end
192
196
local state = files .compileState (uri )
193
197
if not state then
194
198
return
@@ -197,7 +201,7 @@ return function (uri, changes)
197
201
local firstChange = changes [1 ]
198
202
if firstChange .range then
199
203
local edits = removeSpacesAfterEnter (state , firstChange )
200
- or fixWrongIdent (state , firstChange )
204
+ or fixWrongIndent (state , firstChange )
201
205
if edits then
202
206
applyEdits (state , edits )
203
207
end
0 commit comments