File tree 1 file changed +5
-6
lines changed
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -49,15 +49,14 @@ function text_edits.guess_text_edit(bufnr, item)
49
49
-- Search forward/backward for the start/end of the word
50
50
local start_col = current_col
51
51
while start_col > 1 do
52
- local char = line :sub (start_col , start_col )
53
- if char :match (' [%w_\\ -]' ) == nil then
54
- start_col = start_col + 1
55
- break
56
- end
52
+ local char = line :sub (start_col - 1 , start_col - 1 )
53
+ if char :match (' [%w_\\ -]' ) == nil then break end
57
54
start_col = start_col - 1
58
55
end
59
56
60
- -- todo: dont search forward since LSPs dont typically do this so it will be inconsistent
57
+ -- todo: optionally dont search forward since LSPs dont typically do this with textEdits
58
+ -- so this will lead to inconsistent behavior
59
+ -- OR add support on textEdits
61
60
local end_col = current_col
62
61
while end_col < # line do
63
62
local char = line :sub (end_col + 1 , end_col + 1 )
You can’t perform that action at this time.
0 commit comments