diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-11-30 21:57:55 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-11-30 21:57:55 +0100 |
commit | 01a060da74b756b161e595b39a7877cb7612120a (patch) | |
tree | 0a608cde574b00583e15130261ead0b91c8a02f6 /src/ex_getln.c | |
parent | 8ff5af9544a2abc3d344bba017ef96682e098d9d (diff) | |
download | vim-git-01a060da74b756b161e595b39a7877cb7612120a.tar.gz |
patch 8.1.0552: saved last search pattern may not be restoredv8.1.0552
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.
Diffstat (limited to 'src/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index acccd2732..bfda94278 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -462,6 +462,7 @@ may_do_incsearch_highlighting( int 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, is_state, &skiplen, &patlen)) @@ -633,6 +634,7 @@ may_adjust_incsearch_highlighting( int save; // 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, is_state, &skiplen, &patlen)) @@ -735,6 +737,7 @@ may_add_char_to_search(int firstc, int *c, incsearch_state_T *is_state) 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, is_state, &skiplen, &patlen)) @@ -742,6 +745,7 @@ may_add_char_to_search(int firstc, int *c, incsearch_state_T *is_state) restore_last_search_pattern(); return FAIL; } + restore_last_search_pattern(); // Add a character from under the cursor for 'incsearch'. if (is_state->did_incsearch) |