vim-patch:9.1.1516: tests: no test that 'incsearch' is updated after search completion (#34808)

Problem:  tests: no test that 'incsearch' is updated after accepting
          search completion.
Solution: Add a test case (zeertzjq).

closes: vim/vim#17682

08e5b128b8
This commit is contained in:
zeertzjq
2025-07-06 17:41:59 +08:00
committed by GitHub
parent 5335d9991f
commit cf5506f0fd
3 changed files with 50 additions and 1 deletions

View File

@ -445,6 +445,45 @@ describe('cmdline', function()
/t.*\n.*\n.^ |
]])
-- 'incsearch' is redrawn after accepting completion
feed('<esc>')
command('set wim=full')
command('set incsearch hlsearch')
feed('/th')
screen:expect([[
{10:th}e |
{2:th}ese |
{10:th}e |
foobar |
{10:th}e{10:th}e |
{10:th}e{10:th}ere |
{1:~ }|*3
/th^ |
]])
feed('<f5>')
screen:expect([[
{10:th}e |
{2:th}ese |
{10:th}e |
foobar |
{10:th}e{10:th}e |
{10:th}e{10:th}ere |
{1:~ }|*2
{100:these}{3: the thethe thethere there }|
/these^ |
]])
feed('<c-n><c-y>')
screen:expect([[
{10:the} |
{2:the}se |
{10:the} |
foobar |
{10:thethe} |
{10:thethe}re |
{1:~ }|*3
/the^ |
]])
feed('<esc>')
end)
end)

View File

@ -4558,6 +4558,16 @@ func Test_search_wildmenu_screendump()
call term_sendkeys(buf, "\<esc>gg/t.*\\n.*\\n.\<tab>")
call VerifyScreenDump(buf, 'Test_search_wildmenu_5', {})
" 'incsearch' is redrawn after accepting completion
call term_sendkeys(buf, "\<esc>:set wim=full\<cr>")
call term_sendkeys(buf, ":set incsearch hlsearch\<cr>")
call term_sendkeys(buf, "/th")
call VerifyScreenDump(buf, 'Test_search_wildmenu_6', {})
call term_sendkeys(buf, "\<f5>")
call VerifyScreenDump(buf, 'Test_search_wildmenu_7', {})
call term_sendkeys(buf, "\<c-n>\<c-y>")
call VerifyScreenDump(buf, 'Test_search_wildmenu_8', {})
call term_sendkeys(buf, "\<esc>")
call StopVimInTerminal(buf)
endfunc