]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1604: completion: incsearch highlight might be lost v9.1.1604
authorGirish Palya <girishji@gmail.com>
Fri, 8 Aug 2025 10:42:10 +0000 (12:42 +0200)
committerChristian Brabandt <cb@256bit.org>
Fri, 8 Aug 2025 10:42:10 +0000 (12:42 +0200)
Problem:  completion: incsearch highlight might be lost after search
          completion (Hirohito Higashi)
Solution: Restore incsearch highlight after dismissing pum with Ctrl-E
          (Girish Palya)

related: #17870
closes: #17891

Signed-off-by: Christian Brabandt <cb@256bit.org>
src/ex_getln.c
src/testdir/dumps/Test_search_wildmenu_9.dump [new file with mode: 0644]
src/testdir/test_cmdline.vim
src/version.c

index 560324c6e8fae26f8818b994ecf6ea3e5ef3a0c6..0febe432b835b735db56e0f8cb633ceb4dfa114f 100644 (file)
@@ -2113,13 +2113,10 @@ getcmdline_int(
        {
 #ifdef FEAT_SEARCH_EXTRA
            // Apply search highlighting
-           if (wild_type == WILD_APPLY)
-           {
-               if (is_state.winid != curwin->w_id)
-                   init_incsearch_state(&is_state);
-               if (KeyTyped || vpeekc() == NUL)
-                   may_do_incsearch_highlighting(firstc, count, &is_state);
-           }
+           if (is_state.winid != curwin->w_id)
+               init_incsearch_state(&is_state);
+           if (KeyTyped || vpeekc() == NUL)
+               may_do_incsearch_highlighting(firstc, count, &is_state);
 #endif
            wild_type = 0;
            goto cmdline_not_changed;
diff --git a/src/testdir/dumps/Test_search_wildmenu_9.dump b/src/testdir/dumps/Test_search_wildmenu_9.dump
new file mode 100644 (file)
index 0000000..54ca283
--- /dev/null
@@ -0,0 +1,10 @@
+|t+0&#ffffff0|h|e| @71
+|t+1&&|h|e+0&&|s|e| @69
+|t|h|e| @71
+|f|o@1|b|a|r| @68
+|t|h|e|t|h|e| @68
+|t|h|e|t|h|e|r|e| @66
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|/+0#0000000&|t|h> @71
index 95940d57b2b2a2b1ec9135494a5297d00172096a..5bc698106abfcf2f91c97260ac62cb25fd0d52a8 100644 (file)
@@ -4631,6 +4631,12 @@ func Test_search_wildmenu_screendump()
   call term_sendkeys(buf, "\<c-n>\<c-y>")
   call VerifyScreenDump(buf, 'Test_search_wildmenu_8', {})
 
+  " 'incsearch' highlight is restored after dismissing popup (Ctrl_E)
+  call term_sendkeys(buf, "\<esc>:set wop=pum is hls&\<cr>")
+  call term_sendkeys(buf, "gg/th\<tab>\<c-e>")
+  call TermWait(buf, 50)
+  call VerifyScreenDump(buf, 'Test_search_wildmenu_9', {})
+
   call term_sendkeys(buf, "\<esc>")
   call StopVimInTerminal(buf)
 endfunc
index deb219172fda6cab884a354e063f45c66771a28c..2cd99fc78c95d53cf97e7e984e14c582ff4b15b9 100644 (file)
@@ -719,6 +719,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1604,
 /**/
     1603,
 /**/