mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 23:31:51 +00:00
vim-patch:8.1.0552: saved last search pattern may not be restored
Problem: Saved last search pattern may not be restored.
Solution: Call restore_last_search_pattern(). Add a check for balancing
saving and restoring the last search pattern.
01a060da74
This commit is contained in:
@@ -423,6 +423,7 @@ static void may_do_incsearch_highlighting(int firstc, long count,
|
||||
char_u use_last_pat;
|
||||
|
||||
// Parsing range may already set the last search pattern.
|
||||
// NOTE: must call restore_last_search_pattern() before returning!
|
||||
save_last_search_pattern();
|
||||
|
||||
if (!do_incsearch_highlighting(firstc, s, &skiplen, &patlen)) {
|
||||
@@ -566,6 +567,7 @@ static int may_add_char_to_search(int firstc, int *c, incsearch_state_T *s)
|
||||
int skiplen, patlen;
|
||||
|
||||
// Parsing range may already set the last search pattern.
|
||||
// NOTE: must call restore_last_search_pattern() before returning!
|
||||
save_last_search_pattern();
|
||||
|
||||
// Add a character from under the cursor for 'incsearch'
|
||||
@@ -573,6 +575,7 @@ static int may_add_char_to_search(int firstc, int *c, incsearch_state_T *s)
|
||||
restore_last_search_pattern();
|
||||
return FAIL;
|
||||
}
|
||||
restore_last_search_pattern();
|
||||
|
||||
if (s->did_incsearch) {
|
||||
curwin->w_cursor = s->match_end;
|
||||
@@ -1445,6 +1448,7 @@ static int may_do_command_line_next_incsearch(int firstc, long count,
|
||||
int skiplen, patlen;
|
||||
|
||||
// Parsing range may already set the last search pattern.
|
||||
// NOTE: must call restore_last_search_pattern() before returning!
|
||||
save_last_search_pattern();
|
||||
|
||||
if (!do_incsearch_highlighting(firstc, s, &skiplen, &patlen)) {
|
||||
|
Reference in New Issue
Block a user