From d29222160d4971150a8d57dab6bfbb040a8eed6d Mon Sep 17 00:00:00 2001 From: luozhiya Date: Sun, 24 Mar 2024 09:31:52 +0800 Subject: [PATCH] Use `get_word` so that the word is the same as in `core.confirm` --- lua/cmp/view/ghost_text_view.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/cmp/view/ghost_text_view.lua b/lua/cmp/view/ghost_text_view.lua index 759567ef9..b2d83b1bc 100644 --- a/lua/cmp/view/ghost_text_view.lua +++ b/lua/cmp/view/ghost_text_view.lua @@ -74,7 +74,7 @@ end --- This function calculates the bytes of the entry to display calculating the number --- of character differences instead of just byte difference. ghost_text_view.text_gen = function(self, line, cursor_col) - local word = self.entry:get_insert_text() + local word = self.entry:get_word() word = str.oneline(word) local word_clen = vim.str_utfindex(word) local cword = string.sub(line, self.entry:get_offset(), cursor_col)