From fbe546e25d21f3184814d696c329d23d146bd615 Mon Sep 17 00:00:00 2001 From: glepnir Date: Sat, 11 Jan 2025 07:58:45 +0800 Subject: vim-patch:9.1.0996: ComplMatchIns may highlight wrong text (#31931) Problem: ComplMatchIns may highlight wrong text Solution: don't highlight in case of fuzzy match, skip-highlight when not inserting anything (glepnir) closes: vim/vim#16404 https://github.com/vim/vim/commit/e890887b8052561ac5f8dce218e578ed28599cc6 --- src/nvim/insexpand.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 419c806592..d1559b00f1 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -966,7 +966,11 @@ static void ins_compl_insert_bytes(char *p, int len) /// -1 mean normal item. int ins_compl_col_range_attr(int col) { - if (col >= compl_col && col < compl_ins_end_col) { + if (get_cot_flags() & kOptCotFlagFuzzy) { + return -1; + } + + if (col >= (compl_col + (int)compl_leader.size) && col < compl_ins_end_col) { return syn_name2attr("ComplMatchIns"); } -- cgit