Skip to content

Commit

Permalink
autocomplete: properly replace current partial symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
jgmdev committed Sep 13, 2022
1 parent 334ef42 commit bead59a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions data/plugins/autocomplete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -636,9 +636,10 @@ command.add(predicate, {
inserted = item.onselect(suggestions_idx, item)
end
if not inserted then
local current_partial = get_partial_symbol()
doc:insert(line, col, text)
doc:remove(line, col, line, col - #partial)
doc:set_selection(line, col + #text - #partial)
doc:remove(line, col, line, col - #current_partial)
doc:set_selection(line, col + #text - #current_partial)
end
reset_suggestions()
end,
Expand Down

0 comments on commit bead59a

Please sign in to comment.