From a8150a2c7d7a111b31e3cefa3f1469122d91e543 Mon Sep 17 00:00:00 2001 From: hrsh7th Date: Sun, 13 Feb 2022 16:47:11 +0900 Subject: [PATCH] Improve complete_common_string --- lua/cmp/core.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cmp/core.lua b/lua/cmp/core.lua index 58d9b15..2bb8c7c 100644 --- a/lua/cmp/core.lua +++ b/lua/cmp/core.lua @@ -249,7 +249,7 @@ core.complete_common_string = function(self) common_string = str.get_common_string(common_string, vim_item.word) end end - if common_string and #common_string > (1 + cursor[2] - offset) then + if common_string and #common_string >= (1 + cursor[2] - offset) then feedkeys.call(keymap.backspace(string.sub(api.get_current_line(), offset, cursor[2])) .. common_string, 'n') return true end