mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
vim-patch:8.1.0399: 'hlsearch' highlight remains in other window
Problem: 'hlsearch' highlight remains in other window after cancelling
command.
Solution: Redraw all windows. Also remove unnecessary delays. (closes vim/vim#3437)
65985ac998
This commit is contained in:
parent
112092fa15
commit
f7d2e37e36
@ -529,7 +529,8 @@ static void may_do_incsearch_highlighting(int firstc, long count,
|
|||||||
if (!use_last_pat) {
|
if (!use_last_pat) {
|
||||||
next_char = ccline.cmdbuff[skiplen + patlen];
|
next_char = ccline.cmdbuff[skiplen + patlen];
|
||||||
ccline.cmdbuff[skiplen + patlen] = NUL;
|
ccline.cmdbuff[skiplen + patlen] = NUL;
|
||||||
if (empty_pattern(ccline.cmdbuff)) {
|
if (empty_pattern(ccline.cmdbuff) && !no_hlsearch) {
|
||||||
|
redraw_all_later(SOME_VALID);
|
||||||
set_no_hlsearch(true);
|
set_no_hlsearch(true);
|
||||||
}
|
}
|
||||||
ccline.cmdbuff[skiplen + patlen] = next_char;
|
ccline.cmdbuff[skiplen + patlen] = next_char;
|
||||||
@ -624,10 +625,9 @@ static void finish_incsearch_highlighting(int gotesc, incsearch_state_T *s,
|
|||||||
p_magic = s->magic_save;
|
p_magic = s->magic_save;
|
||||||
|
|
||||||
validate_cursor(); // needed for TAB
|
validate_cursor(); // needed for TAB
|
||||||
|
redraw_all_later(SOME_VALID);
|
||||||
if (call_update_screen) {
|
if (call_update_screen) {
|
||||||
update_screen(SOME_VALID);
|
update_screen(SOME_VALID);
|
||||||
} else {
|
|
||||||
redraw_all_later(SOME_VALID);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -639,7 +639,6 @@ func Test_incsearch_substitute_dump()
|
|||||||
call term_sendkeys(buf, 'o')
|
call term_sendkeys(buf, 'o')
|
||||||
sleep 100m
|
sleep 100m
|
||||||
call term_sendkeys(buf, 'o')
|
call term_sendkeys(buf, 'o')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_01', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_01', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
@ -647,30 +646,25 @@ func Test_incsearch_substitute_dump()
|
|||||||
call term_sendkeys(buf, "/foo\<CR>")
|
call term_sendkeys(buf, "/foo\<CR>")
|
||||||
sleep 100m
|
sleep 100m
|
||||||
call term_sendkeys(buf, ':.,.+2s//')
|
call term_sendkeys(buf, ':.,.+2s//')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_02', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_02', {})
|
||||||
|
|
||||||
" Deleting last slash should remove the match.
|
" Deleting last slash should remove the match.
|
||||||
call term_sendkeys(buf, "\<BS>")
|
call term_sendkeys(buf, "\<BS>")
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_03', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_03', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
" Reverse range is accepted
|
" Reverse range is accepted
|
||||||
call term_sendkeys(buf, ':5,2s/foo')
|
call term_sendkeys(buf, ':5,2s/foo')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_04', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_04', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
" White space after the command is skipped
|
" White space after the command is skipped
|
||||||
call term_sendkeys(buf, ':2,3sub /fo')
|
call term_sendkeys(buf, ':2,3sub /fo')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_05', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_05', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
" Command modifiers are skipped
|
" Command modifiers are skipped
|
||||||
call term_sendkeys(buf, ':above below browse botr confirm keepmar keepalt keeppat keepjum filter xxx hide lockm leftabove noau noswap rightbel sandbox silent silent! $tab top unsil vert verbose 4,5s/fo.')
|
call term_sendkeys(buf, ':above below browse botr confirm keepmar keepalt keeppat keepjum filter xxx hide lockm leftabove noau noswap rightbel sandbox silent silent! $tab top unsil vert verbose 4,5s/fo.')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_06', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_06', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
@ -678,13 +672,11 @@ func Test_incsearch_substitute_dump()
|
|||||||
call term_sendkeys(buf, ":set cursorline\<CR>")
|
call term_sendkeys(buf, ":set cursorline\<CR>")
|
||||||
call term_sendkeys(buf, 'G9G')
|
call term_sendkeys(buf, 'G9G')
|
||||||
call term_sendkeys(buf, ':9,11s/bar')
|
call term_sendkeys(buf, ':9,11s/bar')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_07', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_07', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
" Cursorline highlighting at cursor when no match
|
" Cursorline highlighting at cursor when no match
|
||||||
call term_sendkeys(buf, ':9,10s/bar')
|
call term_sendkeys(buf, ':9,10s/bar')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_08', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_08', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
@ -692,7 +684,6 @@ func Test_incsearch_substitute_dump()
|
|||||||
call term_sendkeys(buf, '3G4G')
|
call term_sendkeys(buf, '3G4G')
|
||||||
call term_sendkeys(buf, ":nohlsearch\<CR>")
|
call term_sendkeys(buf, ":nohlsearch\<CR>")
|
||||||
call term_sendkeys(buf, ':6,7s/\v')
|
call term_sendkeys(buf, ':6,7s/\v')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_09', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_09', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
@ -705,6 +696,15 @@ func Test_incsearch_substitute_dump()
|
|||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_10', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_10', {})
|
||||||
|
|
||||||
|
call term_sendkeys(buf, ":split\<CR>")
|
||||||
|
call term_sendkeys(buf, ":let @/ = 'xyz'\<CR>")
|
||||||
|
call term_sendkeys(buf, ":%s/.")
|
||||||
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_11', {})
|
||||||
|
call term_sendkeys(buf, "\<BS>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_12', {})
|
||||||
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_13', {})
|
||||||
|
|
||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
call delete('Xis_subst_script')
|
call delete('Xis_subst_script')
|
||||||
endfunc
|
endfunc
|
||||||
@ -728,7 +728,6 @@ func Test_incsearch_sort_dump()
|
|||||||
|
|
||||||
" Need to send one key at a time to force a redraw.
|
" Need to send one key at a time to force a redraw.
|
||||||
call term_sendkeys(buf, ':sort ni u /on')
|
call term_sendkeys(buf, ':sort ni u /on')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_sort_01', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_sort_01', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
@ -755,27 +754,22 @@ func Test_incsearch_vimgrep_dump()
|
|||||||
|
|
||||||
" Need to send one key at a time to force a redraw.
|
" Need to send one key at a time to force a redraw.
|
||||||
call term_sendkeys(buf, ':vimgrep on')
|
call term_sendkeys(buf, ':vimgrep on')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_01', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_01', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
call term_sendkeys(buf, ':vimg /on/ *.txt')
|
call term_sendkeys(buf, ':vimg /on/ *.txt')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_02', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_02', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
call term_sendkeys(buf, ':vimgrepadd "\<on')
|
call term_sendkeys(buf, ':vimgrepadd "\<on')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_03', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_03', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
call term_sendkeys(buf, ':lv "tha')
|
call term_sendkeys(buf, ':lv "tha')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_04', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_04', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
call term_sendkeys(buf, ':lvimgrepa "the" **/*.txt')
|
call term_sendkeys(buf, ':lvimgrepa "the" **/*.txt')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_05', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_vimgrep_05', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
@ -918,13 +912,11 @@ func Test_incsearch_search_dump()
|
|||||||
|
|
||||||
" Need to send one key at a time to force a redraw.
|
" Need to send one key at a time to force a redraw.
|
||||||
call term_sendkeys(buf, '/fo')
|
call term_sendkeys(buf, '/fo')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_search_01', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_search_01', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
sleep 100m
|
sleep 100m
|
||||||
|
|
||||||
call term_sendkeys(buf, '/\v')
|
call term_sendkeys(buf, '/\v')
|
||||||
sleep 100m
|
|
||||||
call VerifyScreenDump(buf, 'Test_incsearch_search_02', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_search_02', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
call term_sendkeys(buf, "\<Esc>")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user