Skip to content

Commit 04c9e78

Browse files
girishjichrisbra
authored andcommitted
patch 9.1.1604: completion: incsearch highlight might be lost
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>
1 parent 3be4ad7 commit 04c9e78

4 files changed

Lines changed: 22 additions & 7 deletions

File tree

src/ex_getln.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,13 +2113,10 @@ getcmdline_int(
21132113
{
21142114
#ifdef FEAT_SEARCH_EXTRA
21152115
// Apply search highlighting
2116-
if (wild_type == WILD_APPLY)
2117-
{
2118-
if (is_state.winid != curwin->w_id)
2119-
init_incsearch_state(&is_state);
2120-
if (KeyTyped || vpeekc() == NUL)
2121-
may_do_incsearch_highlighting(firstc, count, &is_state);
2122-
}
2116+
if (is_state.winid != curwin->w_id)
2117+
init_incsearch_state(&is_state);
2118+
if (KeyTyped || vpeekc() == NUL)
2119+
may_do_incsearch_highlighting(firstc, count, &is_state);
21232120
#endif
21242121
wild_type = 0;
21252122
goto cmdline_not_changed;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
|t+0&#ffffff0|h|e| @71
2+
|t+1&&|h|e+0&&|s|e| @69
3+
|t|h|e| @71
4+
|f|o@1|b|a|r| @68
5+
|t|h|e|t|h|e| @68
6+
|t|h|e|t|h|e|r|e| @66
7+
|~+0#4040ff13&| @73
8+
|~| @73
9+
|~| @73
10+
|/+0#0000000&|t|h> @71

src/testdir/test_cmdline.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4631,6 +4631,12 @@ func Test_search_wildmenu_screendump()
46314631
call term_sendkeys(buf, "\<c-n>\<c-y>")
46324632
call VerifyScreenDump(buf, 'Test_search_wildmenu_8', {})
46334633

4634+
" 'incsearch' highlight is restored after dismissing popup (Ctrl_E)
4635+
call term_sendkeys(buf, "\<esc>:set wop=pum is hls&\<cr>")
4636+
call term_sendkeys(buf, "gg/th\<tab>\<c-e>")
4637+
call TermWait(buf, 50)
4638+
call VerifyScreenDump(buf, 'Test_search_wildmenu_9', {})
4639+
46344640
call term_sendkeys(buf, "\<esc>")
46354641
call StopVimInTerminal(buf)
46364642
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,8 @@ static char *(features[]) =
719719

720720
static int included_patches[] =
721721
{ /* Add new patch number below this line */
722+
/**/
723+
1604,
722724
/**/
723725
1603,
724726
/**/

0 commit comments

Comments
 (0)