From 227306a339e81549dc9903d39c35c4f988b385f0 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Mon, 27 Feb 2023 13:39:25 +0700 Subject: [PATCH] fix: de-duplicate completion correctly (#1466) --- lua/cmp/entry.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cmp/entry.lua b/lua/cmp/entry.lua index fbecaf4..c9b09b8 100644 --- a/lua/cmp/entry.lua +++ b/lua/cmp/entry.lua @@ -268,7 +268,7 @@ entry.get_vim_item = function(self, suggest_offset) -- remove duplicated string. if self:get_offset() ~= self.context.cursor.col then - for i = 1, #word - 1 do + for i = 1, #word do if str.has_prefix(self.context.cursor_after_line, string.sub(word, i, #word)) then word = string.sub(word, 1, i - 1) break