mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
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:
@ -1465,7 +1465,6 @@ static int command_line_execute(VimState *state, int key)
|
|||||||
|
|
||||||
// If already used to cancel/accept wildmenu, don't process the key further.
|
// If already used to cancel/accept wildmenu, don't process the key further.
|
||||||
if (wild_type == WILD_CANCEL || wild_type == WILD_APPLY) {
|
if (wild_type == WILD_CANCEL || wild_type == WILD_APPLY) {
|
||||||
return command_line_not_changed(s);
|
|
||||||
// Apply search highlighting
|
// Apply search highlighting
|
||||||
if (wild_type == WILD_APPLY) {
|
if (wild_type == WILD_APPLY) {
|
||||||
if (s->is_state.winid != curwin->handle) {
|
if (s->is_state.winid != curwin->handle) {
|
||||||
@ -1475,6 +1474,7 @@ static int command_line_execute(VimState *state, int key)
|
|||||||
may_do_incsearch_highlighting(s->firstc, s->count, &s->is_state);
|
may_do_incsearch_highlighting(s->firstc, s->count, &s->is_state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return command_line_not_changed(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
return command_line_handle_key(s);
|
return command_line_handle_key(s);
|
||||||
|
@ -445,6 +445,45 @@ describe('cmdline', function()
|
|||||||
/t.*\n.*\n.^ |
|
/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>')
|
feed('<esc>')
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
@ -4558,6 +4558,16 @@ func Test_search_wildmenu_screendump()
|
|||||||
call term_sendkeys(buf, "\<esc>gg/t.*\\n.*\\n.\<tab>")
|
call term_sendkeys(buf, "\<esc>gg/t.*\\n.*\\n.\<tab>")
|
||||||
call VerifyScreenDump(buf, 'Test_search_wildmenu_5', {})
|
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 term_sendkeys(buf, "\<esc>")
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
endfunc
|
||||||
|
Reference in New Issue
Block a user