]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1005: completion text is highlighted even with no pattern found v9.1.1005
authorglepnir <glephunter@gmail.com>
Sat, 11 Jan 2025 15:42:50 +0000 (16:42 +0100)
committerChristian Brabandt <cb@256bit.org>
Sat, 11 Jan 2025 15:42:50 +0000 (16:42 +0100)
Problem:  completion text is highlighted even with no pattern found
Solution: use ins_compl_leader_len() instead of checking
          compl_leader.length (glepnir)

closes: #16422

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/insexpand.c
src/testdir/dumps/Test_pum_matchins_combine_09.dump [new file with mode: 0644]
src/testdir/test_popup.vim
src/version.c

index 22f021de7ef81bf22c66631729d492910cae8c01..4a02f0ec8eb8ccb0acd71a5d8c16f6ec72555745 100644 (file)
@@ -927,7 +927,7 @@ ins_compl_col_range_attr(int col)
     if ((get_cot_flags() & COT_FUZZY))
        return -1;
 
-    if (col >= (compl_col + (int)compl_leader.length) && col < compl_ins_end_col)
+    if (col >= (compl_col + (int)ins_compl_leader_len()) && col < compl_ins_end_col)
        return syn_name2attr((char_u *)"ComplMatchIns");
 
     return -1;
diff --git a/src/testdir/dumps/Test_pum_matchins_combine_09.dump b/src/testdir/dumps/Test_pum_matchins_combine_09.dump
new file mode 100644 (file)
index 0000000..d7904b2
--- /dev/null
@@ -0,0 +1,20 @@
+|f+8&#40ff4011> @73
+|~+0#4040ff13#4040ff13| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|-+2#0000000&@1| |K|e|y|w|o|r|d| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |P+0#ffffff16#e000002|a|t@1|e|r|n| |n|o|t| |f|o|u|n|d| +0#0000000#4040ff13@28
index 3f4836fa80322a54460de814170926a9cd57001a..0303c42bd69f5036ad81f23b2903be0b17851ac2 100644 (file)
@@ -1829,6 +1829,13 @@ func Test_pum_matchins_highlight_combine()
   call term_sendkeys(buf, "S\<C-X>\<C-O>f\<C-N>")
   call VerifyScreenDump(buf, 'Test_pum_matchins_combine_08', {})
   call term_sendkeys(buf, "\<C-E>\<Esc>")
+  call TermWait(buf)
+
+  call term_sendkeys(buf, ":set cot-=fuzzy\<CR>")
+  call TermWait(buf)
+  call term_sendkeys(buf, "Sf\<C-N>")
+  call VerifyScreenDump(buf, 'Test_pum_matchins_combine_09', {})
+  call term_sendkeys(buf, "\<C-E>\<Esc>")
 
   call StopVimInTerminal(buf)
 endfunc
index 6179cb3f9b7513880f3338f3ca3acaaad4fe3b18..1927d9e82e473e6e22a31a3ea262face8c86e70c 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1005,
 /**/
     1004,
 /**/