]>
Commit | Line | Data |
---|---|---|
ef0610d1 AG |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.2.215 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
10 | Patch 7.2.215 | |
11 | Problem: ml_get error when using ":vimgrep". | |
12 | Solution: Load the memfile for the hidden buffer before putting it in a | |
13 | window. Correct the order of splitting the window and filling | |
14 | the window and buffer with data. | |
15 | Files: src/fileio.c, src/proto/window.pro, src/quickfix.c, src/window.c | |
16 | ||
17 | ||
18 | *** ../vim-7.2.214/src/fileio.c 2009-06-24 11:57:53.000000000 +0200 | |
19 | --- src/fileio.c 2009-06-24 12:53:19.000000000 +0200 | |
20 | *************** | |
21 | *** 710,716 **** | |
22 | #endif | |
23 | #ifdef UNIX | |
24 | /* Set swap file protection bits after creating it. */ | |
25 | ! if (swap_mode > 0 && curbuf->b_ml.ml_mfp->mf_fname != NULL) | |
26 | (void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode); | |
27 | #endif | |
28 | } | |
29 | --- 710,717 ---- | |
30 | #endif | |
31 | #ifdef UNIX | |
32 | /* Set swap file protection bits after creating it. */ | |
33 | ! if (swap_mode > 0 && curbuf->b_ml.ml_mfp != NULL | |
34 | ! && curbuf->b_ml.ml_mfp->mf_fname != NULL) | |
35 | (void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode); | |
36 | #endif | |
37 | } | |
38 | *************** | |
39 | *** 8435,8443 **** | |
40 | * effects, insert it in a the current tab page. | |
41 | * Anything related to a window (e.g., setting folds) may have | |
42 | * unexpected results. */ | |
43 | ! curwin = aucmd_win; | |
44 | ! curwin->w_buffer = buf; | |
45 | ++buf->b_nwindows; | |
46 | ||
47 | #ifdef FEAT_WINDOWS | |
48 | /* Split the current window, put the aucmd_win in the upper half. */ | |
49 | --- 8436,8444 ---- | |
50 | * effects, insert it in a the current tab page. | |
51 | * Anything related to a window (e.g., setting folds) may have | |
52 | * unexpected results. */ | |
53 | ! aucmd_win->w_buffer = buf; | |
54 | ++buf->b_nwindows; | |
55 | + win_init_empty(aucmd_win); /* set cursor and topline to safe values */ | |
56 | ||
57 | #ifdef FEAT_WINDOWS | |
58 | /* Split the current window, put the aucmd_win in the upper half. */ | |
59 | *************** | |
60 | *** 8448,8459 **** | |
61 | (void)win_comp_pos(); /* recompute window positions */ | |
62 | p_ea = save_ea; | |
63 | #endif | |
64 | ! /* set cursor and topline to safe values */ | |
65 | ! curwin_init(); | |
66 | ! #ifdef FEAT_VERTSPLIT | |
67 | ! curwin->w_wincol = 0; | |
68 | ! curwin->w_width = Columns; | |
69 | ! #endif | |
70 | } | |
71 | curbuf = buf; | |
72 | aco->new_curwin = curwin; | |
73 | --- 8449,8455 ---- | |
74 | (void)win_comp_pos(); /* recompute window positions */ | |
75 | p_ea = save_ea; | |
76 | #endif | |
77 | ! curwin = aucmd_win; | |
78 | } | |
79 | curbuf = buf; | |
80 | aco->new_curwin = curwin; | |
81 | *** ../vim-7.2.214/src/proto/window.pro 2009-06-16 16:01:34.000000000 +0200 | |
82 | --- src/proto/window.pro 2009-06-24 12:53:13.000000000 +0200 | |
83 | *************** | |
84 | *** 14,19 **** | |
85 | --- 14,20 ---- | |
86 | win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp)); | |
87 | void close_others __ARGS((int message, int forceit)); | |
88 | void curwin_init __ARGS((void)); | |
89 | + void win_init_empty __ARGS((win_T *wp)); | |
90 | int win_alloc_first __ARGS((void)); | |
91 | void win_alloc_aucmd_win __ARGS((void)); | |
92 | void win_init_size __ARGS((void)); | |
93 | *** ../vim-7.2.214/src/quickfix.c 2009-05-17 13:30:58.000000000 +0200 | |
94 | --- src/quickfix.c 2009-06-24 15:30:06.000000000 +0200 | |
95 | *************** | |
96 | *** 3411,3424 **** | |
97 | /* Init the options. */ | |
98 | buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP); | |
99 | ||
100 | ! /* set curwin/curbuf to buf and save a few things */ | |
101 | ! aucmd_prepbuf(&aco, newbuf); | |
102 | ||
103 | ! /* Need to set the filename for autocommands. */ | |
104 | ! (void)setfname(curbuf, fname, NULL, FALSE); | |
105 | ||
106 | - if (ml_open(curbuf) == OK) | |
107 | - { | |
108 | /* Create swap file now to avoid the ATTENTION message. */ | |
109 | check_need_swap(TRUE); | |
110 | ||
111 | --- 3411,3425 ---- | |
112 | /* Init the options. */ | |
113 | buf_copy_options(newbuf, BCO_ENTER | BCO_NOHELP); | |
114 | ||
115 | ! /* need to open the memfile before putting the buffer in a window */ | |
116 | ! if (ml_open(newbuf) == OK) | |
117 | ! { | |
118 | ! /* set curwin/curbuf to buf and save a few things */ | |
119 | ! aucmd_prepbuf(&aco, newbuf); | |
120 | ||
121 | ! /* Need to set the filename for autocommands. */ | |
122 | ! (void)setfname(curbuf, fname, NULL, FALSE); | |
123 | ||
124 | /* Create swap file now to avoid the ATTENTION message. */ | |
125 | check_need_swap(TRUE); | |
126 | ||
127 | *************** | |
128 | *** 3441,3450 **** | |
129 | newbuf = curbuf; | |
130 | } | |
131 | } | |
132 | - } | |
133 | ||
134 | ! /* restore curwin/curbuf and a few other things */ | |
135 | ! aucmd_restbuf(&aco); | |
136 | ||
137 | if (!buf_valid(newbuf)) | |
138 | return NULL; | |
139 | --- 3442,3451 ---- | |
140 | newbuf = curbuf; | |
141 | } | |
142 | } | |
143 | ||
144 | ! /* restore curwin/curbuf and a few other things */ | |
145 | ! aucmd_restbuf(&aco); | |
146 | ! } | |
147 | ||
148 | if (!buf_valid(newbuf)) | |
149 | return NULL; | |
150 | *** ../vim-7.2.214/src/window.c 2009-06-16 16:01:34.000000000 +0200 | |
151 | --- src/window.c 2009-06-24 14:35:16.000000000 +0200 | |
152 | *************** | |
153 | *** 2354,2366 **** | |
154 | frame_T *frp; | |
155 | win_T *wp; | |
156 | ||
157 | - #ifdef FEAT_FOLDING | |
158 | - clearFolding(win); | |
159 | - #endif | |
160 | - | |
161 | - /* reduce the reference count to the argument list. */ | |
162 | - alist_unlink(win->w_alist); | |
163 | - | |
164 | /* Remove the window and its frame from the tree of frames. */ | |
165 | frp = win->w_frame; | |
166 | wp = winframe_remove(win, dirp, tp); | |
167 | --- 2354,2359 ---- | |
168 | *************** | |
169 | *** 2386,2394 **** | |
170 | tabpage_close(TRUE); | |
171 | # endif | |
172 | ||
173 | - while (firstwin != NULL) | |
174 | - (void)win_free_mem(firstwin, &dummy, NULL); | |
175 | - | |
176 | # ifdef FEAT_AUTOCMD | |
177 | if (aucmd_win != NULL) | |
178 | { | |
179 | --- 2379,2384 ---- | |
180 | *************** | |
181 | *** 2396,2401 **** | |
182 | --- 2386,2394 ---- | |
183 | aucmd_win = NULL; | |
184 | } | |
185 | # endif | |
186 | + | |
187 | + while (firstwin != NULL) | |
188 | + (void)win_free_mem(firstwin, &dummy, NULL); | |
189 | } | |
190 | #endif | |
191 | ||
192 | *************** | |
193 | *** 3204,3230 **** | |
194 | void | |
195 | curwin_init() | |
196 | { | |
197 | ! redraw_win_later(curwin, NOT_VALID); | |
198 | ! curwin->w_lines_valid = 0; | |
199 | ! curwin->w_cursor.lnum = 1; | |
200 | ! curwin->w_curswant = curwin->w_cursor.col = 0; | |
201 | #ifdef FEAT_VIRTUALEDIT | |
202 | ! curwin->w_cursor.coladd = 0; | |
203 | #endif | |
204 | ! curwin->w_pcmark.lnum = 1; /* pcmark not cleared but set to line 1 */ | |
205 | ! curwin->w_pcmark.col = 0; | |
206 | ! curwin->w_prev_pcmark.lnum = 0; | |
207 | ! curwin->w_prev_pcmark.col = 0; | |
208 | ! curwin->w_topline = 1; | |
209 | #ifdef FEAT_DIFF | |
210 | ! curwin->w_topfill = 0; | |
211 | #endif | |
212 | ! curwin->w_botline = 2; | |
213 | #ifdef FEAT_FKMAP | |
214 | ! if (curwin->w_p_rl) | |
215 | ! curwin->w_farsi = W_CONV + W_R_L; | |
216 | else | |
217 | ! curwin->w_farsi = W_CONV; | |
218 | #endif | |
219 | } | |
220 | ||
221 | --- 3197,3230 ---- | |
222 | void | |
223 | curwin_init() | |
224 | { | |
225 | ! win_init_empty(curwin); | |
226 | ! } | |
227 | ! | |
228 | ! void | |
229 | ! win_init_empty(wp) | |
230 | ! win_T *wp; | |
231 | ! { | |
232 | ! redraw_win_later(wp, NOT_VALID); | |
233 | ! wp->w_lines_valid = 0; | |
234 | ! wp->w_cursor.lnum = 1; | |
235 | ! wp->w_curswant = wp->w_cursor.col = 0; | |
236 | #ifdef FEAT_VIRTUALEDIT | |
237 | ! wp->w_cursor.coladd = 0; | |
238 | #endif | |
239 | ! wp->w_pcmark.lnum = 1; /* pcmark not cleared but set to line 1 */ | |
240 | ! wp->w_pcmark.col = 0; | |
241 | ! wp->w_prev_pcmark.lnum = 0; | |
242 | ! wp->w_prev_pcmark.col = 0; | |
243 | ! wp->w_topline = 1; | |
244 | #ifdef FEAT_DIFF | |
245 | ! wp->w_topfill = 0; | |
246 | #endif | |
247 | ! wp->w_botline = 2; | |
248 | #ifdef FEAT_FKMAP | |
249 | ! if (wp->w_p_rl) | |
250 | ! wp->w_farsi = W_CONV + W_R_L; | |
251 | else | |
252 | ! wp->w_farsi = W_CONV; | |
253 | #endif | |
254 | } | |
255 | ||
256 | *************** | |
257 | *** 4325,4330 **** | |
258 | --- 4325,4337 ---- | |
259 | { | |
260 | int i; | |
261 | ||
262 | + #ifdef FEAT_FOLDING | |
263 | + clearFolding(wp); | |
264 | + #endif | |
265 | + | |
266 | + /* reduce the reference count to the argument list. */ | |
267 | + alist_unlink(wp->w_alist); | |
268 | + | |
269 | #ifdef FEAT_AUTOCMD | |
270 | /* Don't execute autocommands while the window is halfway being deleted. | |
271 | * gui_mch_destroy_scrollbar() may trigger a FocusGained event. */ | |
272 | *************** | |
273 | *** 4387,4393 **** | |
274 | } | |
275 | #endif /* FEAT_GUI */ | |
276 | ||
277 | ! win_remove(wp, tp); | |
278 | vim_free(wp); | |
279 | ||
280 | #ifdef FEAT_AUTOCMD | |
281 | --- 4394,4403 ---- | |
282 | } | |
283 | #endif /* FEAT_GUI */ | |
284 | ||
285 | ! #ifdef FEAT_AUTOCMD | |
286 | ! if (wp != aucmd_win) | |
287 | ! #endif | |
288 | ! win_remove(wp, tp); | |
289 | vim_free(wp); | |
290 | ||
291 | #ifdef FEAT_AUTOCMD | |
292 | *** ../vim-7.2.214/src/version.c 2009-06-24 17:04:40.000000000 +0200 | |
293 | --- src/version.c 2009-06-24 17:27:38.000000000 +0200 | |
294 | *************** | |
295 | *** 678,679 **** | |
296 | --- 678,681 ---- | |
297 | { /* Add new patch number below this line */ | |
298 | + /**/ | |
299 | + 215, | |
300 | /**/ | |
301 | ||
302 | -- | |
303 | Micro$oft: where do you want to go today? | |
304 | Linux: where do you want to go tomorrow? | |
305 | FreeBSD: are you guys coming, or what? | |
306 | ||
307 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
308 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
309 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
310 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |