mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 10:18:18 +00:00
vim-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)
f13daa46da
This commit is contained in:
@@ -604,13 +604,19 @@ static void finish_incsearch_highlighting(int gotesc, incsearch_state_T *s,
|
|||||||
}
|
}
|
||||||
restore_viewstate(&s->old_viewstate);
|
restore_viewstate(&s->old_viewstate);
|
||||||
highlight_match = false;
|
highlight_match = false;
|
||||||
|
|
||||||
|
// by default search all lines
|
||||||
|
search_first_line = 0;
|
||||||
|
search_last_line = MAXLNUM;
|
||||||
|
|
||||||
|
p_magic = s->magic_save;
|
||||||
|
|
||||||
validate_cursor(); // needed for TAB
|
validate_cursor(); // needed for TAB
|
||||||
if (call_update_screen) {
|
if (call_update_screen) {
|
||||||
update_screen(SOME_VALID);
|
update_screen(SOME_VALID);
|
||||||
} else {
|
} else {
|
||||||
redraw_all_later(SOME_VALID);
|
redraw_all_later(SOME_VALID);
|
||||||
}
|
}
|
||||||
p_magic = s->magic_save;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -696,6 +696,15 @@ func Test_incsearch_substitute_dump()
|
|||||||
call VerifyScreenDump(buf, 'Test_incsearch_substitute_09', {})
|
call VerifyScreenDump(buf, 'Test_incsearch_substitute_09', {})
|
||||||
call term_sendkeys(buf, "\<Esc>")
|
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 StopVimInTerminal(buf)
|
||||||
call delete('Xis_subst_script')
|
call delete('Xis_subst_script')
|
||||||
endfunc
|
endfunc
|
||||||
|
Reference in New Issue
Block a user