From bead59a8981202d2de7303094121fd317f772fb1 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Mon, 12 Sep 2022 22:41:50 -0400 Subject: [PATCH] autocomplete: properly replace current partial symbol --- data/plugins/autocomplete.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/plugins/autocomplete.lua b/data/plugins/autocomplete.lua index 9a223b5e..d638d4ff 100644 --- a/data/plugins/autocomplete.lua +++ b/data/plugins/autocomplete.lua @@ -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,