autocomplete: properly replace current partial symbol
This commit is contained in:
parent
334ef427c1
commit
bead59a898
|
@ -636,9 +636,10 @@ command.add(predicate, {
|
||||||
inserted = item.onselect(suggestions_idx, item)
|
inserted = item.onselect(suggestions_idx, item)
|
||||||
end
|
end
|
||||||
if not inserted then
|
if not inserted then
|
||||||
|
local current_partial = get_partial_symbol()
|
||||||
doc:insert(line, col, text)
|
doc:insert(line, col, text)
|
||||||
doc:remove(line, col, line, col - #partial)
|
doc:remove(line, col, line, col - #current_partial)
|
||||||
doc:set_selection(line, col + #text - #partial)
|
doc:set_selection(line, col + #text - #current_partial)
|
||||||
end
|
end
|
||||||
reset_suggestions()
|
reset_suggestions()
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Reference in New Issue