1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0556
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.0556
Problem: Saving/restoring search patterns share saved last_idx.
Solution: Use a separate saved last_idx for saving search patterns for
functions and incremental search.
Files: src/search.c
*** ../vim-8.1.0555/src/search.c 2018-12-01 13:14:40.883412219 +0100
--- src/search.c 2018-12-01 21:01:43.478639117 +0100
***************
*** 93,104 ****
/* copy of spats[], for keeping the search patterns while executing autocmds */
static struct spat saved_spats[2];
# ifdef FEAT_SEARCH_EXTRA
! /* 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
static char_u *mr_pattern = NULL; /* pattern used by search_regcomp() */
--- 93,100 ----
/* copy of spats[], for keeping the search patterns while executing autocmds */
static struct spat saved_spats[2];
# ifdef FEAT_SEARCH_EXTRA
! static int saved_spats_last_idx = 0;
! static int saved_spats_no_hlsearch = 0;
# endif
static char_u *mr_pattern = NULL; /* pattern used by search_regcomp() */
***************
*** 310,317 ****
if (spats[1].pat != NULL)
saved_spats[1].pat = vim_strsave(spats[1].pat);
#ifdef FEAT_SEARCH_EXTRA
! saved_last_idx = last_idx;
! saved_no_hlsearch = no_hlsearch;
#endif
}
}
--- 306,313 ----
if (spats[1].pat != NULL)
saved_spats[1].pat = vim_strsave(spats[1].pat);
#ifdef FEAT_SEARCH_EXTRA
! saved_spats_last_idx = last_idx;
! saved_spats_no_hlsearch = no_hlsearch;
#endif
}
}
***************
*** 329,336 ****
vim_free(spats[1].pat);
spats[1] = saved_spats[1];
#ifdef FEAT_SEARCH_EXTRA
! last_idx = saved_last_idx;
! set_no_hlsearch(saved_no_hlsearch);
#endif
}
}
--- 325,332 ----
vim_free(spats[1].pat);
spats[1] = saved_spats[1];
#ifdef FEAT_SEARCH_EXTRA
! last_idx = saved_spats_last_idx;
! set_no_hlsearch(saved_spats_no_hlsearch);
#endif
}
}
***************
*** 354,359 ****
--- 350,362 ----
#endif
#ifdef FEAT_SEARCH_EXTRA
+ // 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;
+
/*
* Save and restore the search pattern for incremental highlight search
* feature.
***************
*** 575,581 ****
saved_spats[idx].pat = NULL;
else
saved_spats[idx].pat = vim_strsave(spats[idx].pat);
! saved_last_idx = last_idx;
}
# ifdef FEAT_SEARCH_EXTRA
/* If 'hlsearch' set and search pat changed: need redraw. */
--- 578,584 ----
saved_spats[idx].pat = NULL;
else
saved_spats[idx].pat = vim_strsave(spats[idx].pat);
! saved_spats_last_idx = last_idx;
}
# ifdef FEAT_SEARCH_EXTRA
/* If 'hlsearch' set and search pat changed: need redraw. */
*** ../vim-8.1.0555/src/version.c 2018-12-01 13:14:40.883412219 +0100
--- src/version.c 2018-12-01 21:06:48.136433537 +0100
***************
*** 794,795 ****
--- 794,797 ----
{ /* Add new patch number below this line */
+ /**/
+ 556,
/**/
--
Corn oil comes from corn and olive oil comes from olives, so where
does baby oil come from?
/// 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 ///
|