0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.1.0339: wrong highlight when 'incsearch' set and cancelling :s

Problem:    Wrong highlight when 'incsearch' set and cancelling :s.
Solution:   Reset search line range. (Hirohito Higashi, Masamichi Abe)
This commit is contained in:
Bram Moolenaar 2018-08-31 22:09:54 +02:00
parent f6ceaf1e05
commit f13daa46da
4 changed files with 27 additions and 1 deletions

View File

@ -436,12 +436,18 @@ finish_incsearch_highlighting(
}
restore_viewstate(&is_state->old_viewstate);
highlight_match = FALSE;
// by default search all lines
search_first_line = 0;
search_last_line = MAXLNUM;
p_magic = is_state->magic_save;
validate_cursor(); /* needed for TAB */
if (call_update_screen)
update_screen(SOME_VALID);
else
redraw_all_later(SOME_VALID);
p_magic = is_state->magic_save;
}
}

View File

@ -0,0 +1,9 @@
|f+0&#ffff4012|o@1| +0&#ffffff0|1| @64
>f+0&#ffff4012|o@1| +0&#ffffff0|2| @64
|f+0&#ffff4012|o@1| +0&#ffffff0|3| @64
|f+0&#ffff4012|o@1| +0&#ffffff0|4| @64
|f+0&#ffff4012|o@1| +0&#ffffff0|5| @64
|f+0&#ffff4012|o@1| +0&#ffffff0|6| @64
|f+0&#ffff4012|o@1| +0&#ffffff0|7| @64
|f+0&#ffff4012|o@1| +0&#ffffff0|8| @64
@52|2|,|1| @10|T|o|p|

View File

@ -956,6 +956,15 @@ func Test_incsearch_substitute_dump()
call VerifyScreenDump(buf, 'Test_incsearch_substitute_09', {})
call term_sendkeys(buf, "\<Esc>")
call term_sendkeys(buf, ":set nocursorline\<CR>")
" All matches are highlighted for 'hlsearch' after the incsearch canceled
call term_sendkeys(buf, "1G*")
call term_sendkeys(buf, ":2,5s/foo")
sleep 100m
call term_sendkeys(buf, "\<Esc>")
call VerifyScreenDump(buf, 'Test_incsearch_substitute_10', {})
call StopVimInTerminal(buf)
call delete('Xis_subst_script')
endfunc

View File

@ -794,6 +794,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
339,
/**/
338,
/**/