summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0552
diff options
context:
space:
mode:
Diffstat (limited to 'data/vim/patches/8.1.0552')
-rw-r--r--data/vim/patches/8.1.0552120
1 files changed, 120 insertions, 0 deletions
diff --git a/data/vim/patches/8.1.0552 b/data/vim/patches/8.1.0552
new file mode 100644
index 000000000..6e27ee01a
--- /dev/null
+++ b/data/vim/patches/8.1.0552
@@ -0,0 +1,120 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 8.1.0552
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 8.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.
+Files: src/ex_getln.c, src/search.c
+
+
+*** ../vim-8.1.0551/src/ex_getln.c 2018-11-24 14:27:36.988474753 +0100
+--- src/ex_getln.c 2018-11-30 21:43:13.477019050 +0100
+***************
+*** 462,467 ****
+--- 462,468 ----
+ 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,638 ****
+--- 634,640 ----
+ 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,740 ****
+--- 737,743 ----
+ 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,747 ****
+--- 745,751 ----
+ restore_last_search_pattern();
+ return FAIL;
+ }
++ restore_last_search_pattern();
+
+ // Add a character from under the cursor for 'incsearch'.
+ if (is_state->did_incsearch)
+*** ../vim-8.1.0551/src/search.c 2018-11-16 16:21:01.633310065 +0100
+--- src/search.c 2018-11-30 21:46:33.771924536 +0100
+***************
+*** 96,101 ****
+--- 96,102 ----
+ /* copy of spats[RE_SEARCH], for keeping the search patterns while incremental
+ * searching */
+ static struct spat saved_last_search_spat;
++ static int did_save_last_search_spat = 0;
+ static int saved_last_idx = 0;
+ static int saved_no_hlsearch = 0;
+ # endif
+***************
+*** 364,369 ****
+--- 365,375 ----
+ void
+ save_last_search_pattern(void)
+ {
++ if (did_save_last_search_spat != 0)
++ IEMSG("did_save_last_search_spat is not zero");
++ else
++ ++did_save_last_search_spat;
++
+ saved_last_search_spat = spats[RE_SEARCH];
+ if (spats[RE_SEARCH].pat != NULL)
+ saved_last_search_spat.pat = vim_strsave(spats[RE_SEARCH].pat);
+***************
+*** 374,381 ****
+--- 380,395 ----
+ void
+ restore_last_search_pattern(void)
+ {
++ if (did_save_last_search_spat != 1)
++ {
++ IEMSG("did_save_last_search_spat is not one");
++ return;
++ }
++ --did_save_last_search_spat;
++
+ vim_free(spats[RE_SEARCH].pat);
+ spats[RE_SEARCH] = saved_last_search_spat;
++ saved_last_search_spat.pat = NULL;
+ # if defined(FEAT_EVAL)
+ set_vv_searchforward();
+ # endif
+*** ../vim-8.1.0551/src/version.c 2018-11-28 21:20:34.096221686 +0100
+--- src/version.c 2018-11-30 21:47:47.412181458 +0100
+***************
+*** 794,795 ****
+--- 794,797 ----
+ { /* Add new patch number below this line */
++ /**/
++ 552,
+ /**/
+
+--
+SIGIRO -- irony detected (iron core dumped)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
+/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\ an exciting new programming language -- http://www.Zimbu.org ///
+ \\\ help me help AIDS victims -- http://ICCF-Holland.org ///