]> git.pld-linux.org Git - packages/vim.git/blob - 7.2.041
- new
[packages/vim.git] / 7.2.041
1 To: vim-dev@vim.org
2 Subject: Patch 7.2.041
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.2.041
11 Problem:    In diff mode, when using two tabs, each with two diffed buffers,
12             editing a buffer of the other tab messes up the diff.  (Matt
13             Mzyzik)
14 Solution:   Only copy options from a window where the buffer was edited that
15             doesn't have 'diff' set or is for the current tab page.
16             Also fix that window options for a buffer are stored with the
17             wrong window.
18 Files:      src/buffer.c, src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c,
19             src/ex_getln.c, src/if_sniff.c, src/main.c, src/netbeans.c,
20             src/normal.c, src/popupmnu.c, src/proto/buffer.pro,
21             src/proto/ex_cmds.pro src/quickfix.c, src/window.c
22
23
24 *** ../vim-7.2.040/src/buffer.c Wed Nov 12 12:51:38 2008
25 --- src/buffer.c        Wed Nov 12 17:45:01 2008
26 ***************
27 *** 33,39 ****
28   static char_u *fname_match __ARGS((regprog_T *prog, char_u *name));
29   #endif
30   static void   buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
31 ! static wininfo_T *find_wininfo __ARGS((buf_T *buf));
32   #ifdef UNIX
33   static buf_T  *buflist_findname_stat __ARGS((char_u *ffname, struct stat *st));
34   static int    otherfile_buf __ARGS((buf_T *buf, char_u *ffname, struct stat *stp));
35 --- 33,39 ----
36   static char_u *fname_match __ARGS((regprog_T *prog, char_u *name));
37   #endif
38   static void   buflist_setfpos __ARGS((buf_T *buf, win_T *win, linenr_T lnum, colnr_T col, int copy_options));
39 ! static wininfo_T *find_wininfo __ARGS((buf_T *buf, int skip_diff_buffer));
40   #ifdef UNIX
41   static buf_T  *buflist_findname_stat __ARGS((char_u *ffname, struct stat *st));
42   static int    otherfile_buf __ARGS((buf_T *buf, char_u *ffname, struct stat *stp));
43 ***************
44 *** 1093,1099 ****
45   #endif
46             setpcmark();
47             retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
48 !                                                 forceit ? ECMD_FORCEIT : 0);
49   
50             /*
51              * do_ecmd() may create a new buffer, then we have to delete
52 --- 1093,1099 ----
53   #endif
54             setpcmark();
55             retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
56 !                                         forceit ? ECMD_FORCEIT : 0, curwin);
57   
58             /*
59              * do_ecmd() may create a new buffer, then we have to delete
60 ***************
61 *** 1316,1322 ****
62       setpcmark();
63       if (!cmdmod.keepalt)
64         curwin->w_alt_fnum = curbuf->b_fnum; /* remember alternate file */
65 !     buflist_altfpos();                         /* remember curpos */
66   
67   #ifdef FEAT_VISUAL
68       /* Don't restart Select mode after switching to another buffer. */
69 --- 1316,1322 ----
70       setpcmark();
71       if (!cmdmod.keepalt)
72         curwin->w_alt_fnum = curbuf->b_fnum; /* remember alternate file */
73 !     buflist_altfpos(curwin);                   /* remember curpos */
74   
75   #ifdef FEAT_VISUAL
76       /* Don't restart Select mode after switching to another buffer. */
77 ***************
78 *** 2404,2425 ****
79       return;
80   }
81   
82   /*
83    * Find info for the current window in buffer "buf".
84    * If not found, return the info for the most recently used window.
85    * Returns NULL when there isn't any info.
86    */
87       static wininfo_T *
88 ! find_wininfo(buf)
89       buf_T     *buf;
90   {
91       wininfo_T *wip;
92   
93       for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
94 !       if (wip->wi_win == curwin)
95             break;
96 !     if (wip == NULL)  /* if no fpos for curwin, use the first in the list */
97 !       wip = buf->b_wininfo;
98       return wip;
99   }
100   
101 --- 2404,2473 ----
102       return;
103   }
104   
105 + #ifdef FEAT_DIFF
106 + static int wininfo_other_tab_diff __ARGS((wininfo_T *wip));
107
108 + /*
109 +  * Return TRUE when "wip" has 'diff' set and the diff is only for another tab
110 +  * page.  That's because a diff is local to a tab page.
111 +  */
112 +     static int
113 + wininfo_other_tab_diff(wip)
114 +     wininfo_T *wip;
115 + {
116 +     win_T     *wp;
117
118 +     if (wip->wi_opt.wo_diff)
119 +     {
120 +       for (wp = firstwin; wp != NULL; wp = wp->w_next)
121 +           /* return FALSE when it's a window in the current tab page, thus
122 +            * the buffer was in diff mode here */
123 +           if (wip->wi_win == wp)
124 +               return FALSE;
125 +       return TRUE;
126 +     }
127 +     return FALSE;
128 + }
129 + #endif
130
131   /*
132    * Find info for the current window in buffer "buf".
133    * If not found, return the info for the most recently used window.
134 +  * When "skip_diff_buffer" is TRUE avoid windows with 'diff' set that is in
135 +  * another tab page.
136    * Returns NULL when there isn't any info.
137    */
138 + /*ARGSUSED*/
139       static wininfo_T *
140 ! find_wininfo(buf, skip_diff_buffer)
141       buf_T     *buf;
142 +     int               skip_diff_buffer;
143   {
144       wininfo_T *wip;
145   
146       for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
147 !       if (wip->wi_win == curwin
148 ! #ifdef FEAT_DIFF
149 !               && (!skip_diff_buffer || !wininfo_other_tab_diff(wip))
150 ! #endif
151 !          )
152             break;
153
154 !     /* If no wininfo for curwin, use the first in the list (that doesn't have
155 !      * 'diff' set and is in another tab page). */
156 !     if (wip == NULL)
157 !     {
158 ! #ifdef FEAT_DIFF
159 !       if (skip_diff_buffer)
160 !       {
161 !           for (wip = buf->b_wininfo; wip != NULL; wip = wip->wi_next)
162 !               if (!wininfo_other_tab_diff(wip))
163 !                   break;
164 !       }
165 !       else
166 ! #endif
167 !           wip = buf->b_wininfo;
168 !     }
169       return wip;
170   }
171   
172 ***************
173 *** 2440,2446 ****
174       clearFolding(curwin);
175   #endif
176   
177 !     wip = find_wininfo(buf);
178       if (wip != NULL && wip->wi_optset)
179       {
180         copy_winopt(&wip->wi_opt, &curwin->w_onebuf_opt);
181 --- 2488,2494 ----
182       clearFolding(curwin);
183   #endif
184   
185 !     wip = find_wininfo(buf, TRUE);
186       if (wip != NULL && wip->wi_optset)
187       {
188         copy_winopt(&wip->wi_opt, &curwin->w_onebuf_opt);
189 ***************
190 *** 2472,2478 ****
191       wininfo_T *wip;
192       static pos_T no_position = {1, 0};
193   
194 !     wip = find_wininfo(buf);
195       if (wip != NULL)
196         return &(wip->wi_fpos);
197       else
198 --- 2520,2526 ----
199       wininfo_T *wip;
200       static pos_T no_position = {1, 0};
201   
202 !     wip = find_wininfo(buf, FALSE);
203       if (wip != NULL)
204         return &(wip->wi_fpos);
205       else
206 ***************
207 *** 2793,2806 ****
208   #endif
209   
210   /*
211 !  * Set alternate cursor position for current window.
212    * Also save the local window option values.
213    */
214       void
215 ! buflist_altfpos()
216   {
217 !     buflist_setfpos(curbuf, curwin, curwin->w_cursor.lnum,
218 !                                                 curwin->w_cursor.col, TRUE);
219   }
220   
221   /*
222 --- 2841,2854 ----
223   #endif
224   
225   /*
226 !  * Set alternate cursor position for the current buffer and window "win".
227    * Also save the local window option values.
228    */
229       void
230 ! buflist_altfpos(win)
231 !     win_T *win;
232   {
233 !     buflist_setfpos(curbuf, win, win->w_cursor.lnum, win->w_cursor.col, TRUE);
234   }
235   
236   /*
237 ***************
238 *** 4492,4498 ****
239                       ECMD_ONE,
240                       ((P_HID(curwin->w_buffer)
241                            || bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0)
242 !                                                              + ECMD_OLDBUF);
243   #ifdef FEAT_AUTOCMD
244             if (use_firstwin)
245                 ++autocmd_no_leave;
246 --- 4540,4546 ----
247                       ECMD_ONE,
248                       ((P_HID(curwin->w_buffer)
249                            || bufIsChanged(curwin->w_buffer)) ? ECMD_HIDE : 0)
250 !                                                      + ECMD_OLDBUF, curwin);
251   #ifdef FEAT_AUTOCMD
252             if (use_firstwin)
253                 ++autocmd_no_leave;
254 *** ../vim-7.2.040/src/ex_cmds.c        Sun Nov  9 13:43:25 2008
255 --- src/ex_cmds.c       Wed Nov 12 22:41:41 2008
256 ***************
257 *** 3052,3058 ****
258         retval = 0;     /* it's in the same file */
259       }
260       else if (do_ecmd(fnum, ffname, sfname, NULL, lnum,
261 !               (P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0)) == OK)
262         retval = -1;    /* opened another file */
263       else
264         retval = 1;     /* error encountered */
265 --- 3052,3059 ----
266         retval = 0;     /* it's in the same file */
267       }
268       else if (do_ecmd(fnum, ffname, sfname, NULL, lnum,
269 !               (P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0),
270 !               curwin) == OK)
271         retval = -1;    /* opened another file */
272       else
273         retval = 1;     /* error encountered */
274 ***************
275 *** 3085,3101 ****
276    *     ECMD_OLDBUF: use existing buffer if it exists
277    *    ECMD_FORCEIT: ! used for Ex command
278    *     ECMD_ADDBUF: don't edit, just add to buffer list
279    *
280    * return FAIL for failure, OK otherwise
281    */
282       int
283 ! do_ecmd(fnum, ffname, sfname, eap, newlnum, flags)
284       int               fnum;
285       char_u    *ffname;
286       char_u    *sfname;
287       exarg_T   *eap;                   /* can be NULL! */
288       linenr_T  newlnum;
289       int               flags;
290   {
291       int               other_file;             /* TRUE if editing another file */
292       int               oldbuf;                 /* TRUE if using existing buffer */
293 --- 3086,3106 ----
294    *     ECMD_OLDBUF: use existing buffer if it exists
295    *    ECMD_FORCEIT: ! used for Ex command
296    *     ECMD_ADDBUF: don't edit, just add to buffer list
297 +  *   oldwin: Should be "curwin" when editing a new buffer in the current
298 +  *           window, NULL when splitting the window first.  When not NULL info
299 +  *           of the previous buffer for "oldwin" is stored.
300    *
301    * return FAIL for failure, OK otherwise
302    */
303       int
304 ! do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
305       int               fnum;
306       char_u    *ffname;
307       char_u    *sfname;
308       exarg_T   *eap;                   /* can be NULL! */
309       linenr_T  newlnum;
310       int               flags;
311 +     win_T     *oldwin;
312   {
313       int               other_file;             /* TRUE if editing another file */
314       int               oldbuf;                 /* TRUE if using existing buffer */
315 ***************
316 *** 3267,3273 ****
317         {
318             if (!cmdmod.keepalt)
319                 curwin->w_alt_fnum = curbuf->b_fnum;
320 !           buflist_altfpos();
321         }
322   
323         if (fnum)
324 --- 3272,3279 ----
325         {
326             if (!cmdmod.keepalt)
327                 curwin->w_alt_fnum = curbuf->b_fnum;
328 !           if (oldwin != NULL)
329 !               buflist_altfpos(oldwin);
330         }
331   
332         if (fnum)
333 ***************
334 *** 3371,3377 ****
335   
336                 /* close the link to the current buffer */
337                 u_sync(FALSE);
338 !               close_buffer(curwin, curbuf,
339                                       (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
340   
341   #ifdef FEAT_AUTOCMD
342 --- 3377,3383 ----
343   
344                 /* close the link to the current buffer */
345                 u_sync(FALSE);
346 !               close_buffer(oldwin, curbuf,
347                                       (flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
348   
349   #ifdef FEAT_AUTOCMD
350 ***************
351 *** 5609,5615 ****
352              */
353             alt_fnum = curbuf->b_fnum;
354             (void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
355 !                                                  ECMD_HIDE + ECMD_SET_HELP);
356             if (!cmdmod.keepalt)
357                 curwin->w_alt_fnum = alt_fnum;
358             empty_fnum = curbuf->b_fnum;
359 --- 5615,5627 ----
360              */
361             alt_fnum = curbuf->b_fnum;
362             (void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
363 !                         ECMD_HIDE + ECMD_SET_HELP,
364 ! #ifdef FEAT_WINDOWS
365 !                         NULL  /* buffer is still open, don't store info */
366 ! #else
367 !                         curwin
368 ! #endif
369 !                   );
370             if (!cmdmod.keepalt)
371                 curwin->w_alt_fnum = alt_fnum;
372             empty_fnum = curbuf->b_fnum;
373 *** ../vim-7.2.040/src/ex_cmds2.c       Sun Sep  7 15:49:45 2008
374 --- src/ex_cmds2.c      Wed Nov 12 17:46:41 2008
375 ***************
376 *** 2132,2139 ****
377          * argument index. */
378         if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
379                       eap, ECMD_LAST,
380 !                     (P_HID(curwin->w_buffer) ? ECMD_HIDE : 0) +
381 !                                  (eap->forceit ? ECMD_FORCEIT : 0)) == FAIL)
382             curwin->w_arg_idx = old_arg_idx;
383         /* like Vi: set the mark where the cursor is in the file. */
384         else if (eap->cmdidx != CMD_argdo)
385 --- 2132,2139 ----
386          * argument index. */
387         if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL,
388                       eap, ECMD_LAST,
389 !                     (P_HID(curwin->w_buffer) ? ECMD_HIDE : 0)
390 !                        + (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL)
391             curwin->w_arg_idx = old_arg_idx;
392         /* like Vi: set the mark where the cursor is in the file. */
393         else if (eap->cmdidx != CMD_argdo)
394 *** ../vim-7.2.040/src/ex_docmd.c       Sun Nov  9 13:43:25 2008
395 --- src/ex_docmd.c      Wed Nov 12 18:04:22 2008
396 ***************
397 *** 7488,7494 ****
398         /* ":new" or ":tabnew" without argument: edit an new empty buffer */
399         setpcmark();
400         (void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE,
401 !                              ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0));
402       }
403       else if ((eap->cmdidx != CMD_split
404   #ifdef FEAT_VERTSPLIT
405 --- 7488,7495 ----
406         /* ":new" or ":tabnew" without argument: edit an new empty buffer */
407         setpcmark();
408         (void)do_ecmd(0, NULL, NULL, eap, ECMD_ONE,
409 !                     ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0),
410 !                     old_curwin == NULL ? curwin : NULL);
411       }
412       else if ((eap->cmdidx != CMD_split
413   #ifdef FEAT_VERTSPLIT
414 ***************
415 *** 7525,7531 ****
416   #ifdef FEAT_LISTCMDS
417                     + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 )
418   #endif
419 !                   ) == FAIL)
420         {
421             /* Editing the file failed.  If the window was split, close it. */
422   #ifdef FEAT_WINDOWS
423 --- 7526,7532 ----
424   #ifdef FEAT_LISTCMDS
425                     + (eap->cmdidx == CMD_badd ? ECMD_ADDBUF : 0 )
426   #endif
427 !                   , old_curwin == NULL ? curwin : NULL) == FAIL)
428         {
429             /* Editing the file failed.  If the window was split, close it. */
430   #ifdef FEAT_WINDOWS
431 *** ../vim-7.2.040/src/ex_getln.c       Sun Sep 14 14:41:44 2008
432 --- src/ex_getln.c      Wed Nov 12 18:06:25 2008
433 ***************
434 *** 6051,6057 ****
435         cmdwin_type = '-';
436   
437       /* Create the command-line buffer empty. */
438 !     (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE);
439       (void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
440       set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
441       set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
442 --- 6051,6057 ----
443         cmdwin_type = '-';
444   
445       /* Create the command-line buffer empty. */
446 !     (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL);
447       (void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
448       set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
449       set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
450 *** ../vim-7.2.040/src/if_sniff.c       Sat Aug  9 19:41:16 2008
451 --- src/if_sniff.c      Wed Nov 12 17:48:46 2008
452 ***************
453 *** 1114,1120 ****
454       char *fname;
455   {
456       ++no_wait_return;
457 !     do_ecmd(0, (char_u *)fname, NULL, NULL, ECMD_ONE, ECMD_HIDE+ECMD_OLDBUF);
458       curbuf->b_sniff = TRUE;
459       --no_wait_return;                                 /* [ex_docmd.c] */
460   }
461 --- 1114,1121 ----
462       char *fname;
463   {
464       ++no_wait_return;
465 !     do_ecmd(0, (char_u *)fname, NULL, NULL, ECMD_ONE, ECMD_HIDE+ECMD_OLDBUF,
466 !           curwin);
467       curbuf->b_sniff = TRUE;
468       --no_wait_return;                                 /* [ex_docmd.c] */
469   }
470 *** ../vim-7.2.040/src/main.c   Sun Nov  9 13:43:25 2008
471 --- src/main.c  Wed Nov 12 17:49:06 2008
472 ***************
473 *** 2588,2594 ****
474   # endif
475             (void)do_ecmd(0, arg_idx < GARGCOUNT
476                           ? alist_name(&GARGLIST[arg_idx]) : NULL,
477 !                         NULL, NULL, ECMD_LASTL, ECMD_HIDE);
478   # ifdef HAS_SWAP_EXISTS_ACTION
479             if (swap_exists_did_quit)
480             {
481 --- 2588,2594 ----
482   # endif
483             (void)do_ecmd(0, arg_idx < GARGCOUNT
484                           ? alist_name(&GARGLIST[arg_idx]) : NULL,
485 !                         NULL, NULL, ECMD_LASTL, ECMD_HIDE, curwin);
486   # ifdef HAS_SWAP_EXISTS_ACTION
487             if (swap_exists_did_quit)
488             {
489 *** ../vim-7.2.040/src/netbeans.c       Sun Jul 13 19:18:03 2008
490 --- src/netbeans.c      Wed Nov 12 17:49:40 2008
491 ***************
492 *** 1795,1801 ****
493             buf->displayname = NULL;
494   
495             netbeansReadFile = 0; /* don't try to open disk file */
496 !           do_ecmd(0, NULL, 0, 0, ECMD_ONE, ECMD_HIDE + ECMD_OLDBUF);
497             netbeansReadFile = 1;
498             buf->bufp = curbuf;
499             maketitle();
500 --- 1795,1801 ----
501             buf->displayname = NULL;
502   
503             netbeansReadFile = 0; /* don't try to open disk file */
504 !           do_ecmd(0, NULL, 0, 0, ECMD_ONE, ECMD_HIDE + ECMD_OLDBUF, curwin);
505             netbeansReadFile = 1;
506             buf->bufp = curbuf;
507             maketitle();
508 ***************
509 *** 1960,1966 ****
510   
511             netbeansReadFile = 0; /* don't try to open disk file */
512             do_ecmd(0, (char_u *)buf->displayname, 0, 0, ECMD_ONE,
513 !                                                    ECMD_HIDE + ECMD_OLDBUF);
514             netbeansReadFile = 1;
515             buf->bufp = curbuf;
516             maketitle();
517 --- 1960,1966 ----
518   
519             netbeansReadFile = 0; /* don't try to open disk file */
520             do_ecmd(0, (char_u *)buf->displayname, 0, 0, ECMD_ONE,
521 !                                            ECMD_HIDE + ECMD_OLDBUF, curwin);
522             netbeansReadFile = 1;
523             buf->bufp = curbuf;
524             maketitle();
525 ***************
526 *** 1979,1985 ****
527             vim_free(buf->displayname);
528             buf->displayname = nb_unquote(args, NULL);
529             do_ecmd(0, (char_u *)buf->displayname, NULL, NULL, ECMD_ONE,
530 !                                                    ECMD_HIDE + ECMD_OLDBUF);
531             buf->bufp = curbuf;
532             buf->initDone = TRUE;
533             doupdate = 1;
534 --- 1979,1985 ----
535             vim_free(buf->displayname);
536             buf->displayname = nb_unquote(args, NULL);
537             do_ecmd(0, (char_u *)buf->displayname, NULL, NULL, ECMD_ONE,
538 !                                            ECMD_HIDE + ECMD_OLDBUF, curwin);
539             buf->bufp = curbuf;
540             buf->initDone = TRUE;
541             doupdate = 1;
542 *** ../vim-7.2.040/src/normal.c Sat Nov  1 13:51:57 2008
543 --- src/normal.c        Wed Nov 12 17:49:50 2008
544 ***************
545 *** 6050,6056 ****
546             autowrite(curbuf, FALSE);
547         setpcmark();
548         (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
549 !                                              P_HID(curbuf) ? ECMD_HIDE : 0);
550         if (cap->nchar == 'F' && lnum >= 0)
551         {
552             curwin->w_cursor.lnum = lnum;
553 --- 6050,6056 ----
554             autowrite(curbuf, FALSE);
555         setpcmark();
556         (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LAST,
557 !                                      P_HID(curbuf) ? ECMD_HIDE : 0, curwin);
558         if (cap->nchar == 'F' && lnum >= 0)
559         {
560             curwin->w_cursor.lnum = lnum;
561 *** ../vim-7.2.040/src/popupmnu.c       Sun Jul 13 19:33:51 2008
562 --- src/popupmnu.c      Wed Nov 12 18:08:07 2008
563 ***************
564 *** 573,579 ****
565                 {
566                     /* Don't want to sync undo in the current buffer. */
567                     ++no_u_sync;
568 !                   res = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, 0);
569                     --no_u_sync;
570                     if (res == OK)
571                     {
572 --- 573,579 ----
573                 {
574                     /* Don't want to sync undo in the current buffer. */
575                     ++no_u_sync;
576 !                   res = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, 0, NULL);
577                     --no_u_sync;
578                     if (res == OK)
579                     {
580 *** ../vim-7.2.040/src/proto/buffer.pro Sun May  6 13:57:53 2007
581 --- src/proto/buffer.pro        Wed Nov 12 17:43:39 2008
582 ***************
583 *** 33,39 ****
584   char_u *getaltfname __ARGS((int errmsg));
585   int buflist_add __ARGS((char_u *fname, int flags));
586   void buflist_slash_adjust __ARGS((void));
587 ! void buflist_altfpos __ARGS((void));
588   int otherfile __ARGS((char_u *ffname));
589   void buf_setino __ARGS((buf_T *buf));
590   void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
591 --- 33,39 ----
592   char_u *getaltfname __ARGS((int errmsg));
593   int buflist_add __ARGS((char_u *fname, int flags));
594   void buflist_slash_adjust __ARGS((void));
595 ! void buflist_altfpos __ARGS((win_T *win));
596   int otherfile __ARGS((char_u *ffname));
597   void buf_setino __ARGS((buf_T *buf));
598   void fileinfo __ARGS((int fullname, int shorthelp, int dont_truncate));
599 *** ../vim-7.2.040/src/proto/ex_cmds.pro        Sun Nov  9 13:43:25 2008
600 --- src/proto/ex_cmds.pro       Wed Nov 12 17:44:27 2008
601 ***************
602 *** 27,33 ****
603   void do_wqall __ARGS((exarg_T *eap));
604   int not_writing __ARGS((void));
605   int getfile __ARGS((int fnum, char_u *ffname, char_u *sfname, int setpm, linenr_T lnum, int forceit));
606 ! int do_ecmd __ARGS((int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T newlnum, int flags));
607   void ex_append __ARGS((exarg_T *eap));
608   void ex_change __ARGS((exarg_T *eap));
609   void ex_z __ARGS((exarg_T *eap));
610 --- 27,33 ----
611   void do_wqall __ARGS((exarg_T *eap));
612   int not_writing __ARGS((void));
613   int getfile __ARGS((int fnum, char_u *ffname, char_u *sfname, int setpm, linenr_T lnum, int forceit));
614 ! int do_ecmd __ARGS((int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T newlnum, int flags, win_T *oldwin));
615   void ex_append __ARGS((exarg_T *eap));
616   void ex_change __ARGS((exarg_T *eap));
617   void ex_z __ARGS((exarg_T *eap));
618 *** ../vim-7.2.040/src/quickfix.c       Thu Jul 24 18:44:59 2008
619 --- src/quickfix.c      Wed Nov 12 18:12:00 2008
620 ***************
621 *** 1420,1425 ****
622 --- 1420,1426 ----
623       win_T             *win;
624       win_T             *altwin;
625   #endif
626 +     win_T             *oldwin = curwin;
627       int                       print_message = TRUE;
628       int                       len;
629   #ifdef FEAT_FOLDING
630 ***************
631 *** 1744,1750 ****
632             }
633             else
634                 ok = do_ecmd(qf_ptr->qf_fnum, NULL, NULL, NULL, (linenr_T)1,
635 !                                                  ECMD_HIDE + ECMD_SET_HELP);
636         }
637         else
638             ok = buflist_getfile(qf_ptr->qf_fnum,
639 --- 1745,1752 ----
640             }
641             else
642                 ok = do_ecmd(qf_ptr->qf_fnum, NULL, NULL, NULL, (linenr_T)1,
643 !                                          ECMD_HIDE + ECMD_SET_HELP,
644 !                                          oldwin == curwin ? curwin : NULL);
645         }
646         else
647             ok = buflist_getfile(qf_ptr->qf_fnum,
648 ***************
649 *** 2267,2272 ****
650 --- 2269,2275 ----
651       win_T     *win;
652       tabpage_T *prevtab = curtab;
653       buf_T     *qf_buf;
654 +     win_T     *oldwin = curwin;
655   
656       if (eap->cmdidx == CMD_lopen || eap->cmdidx == CMD_lwindow)
657       {
658 ***************
659 *** 2326,2339 ****
660             win->w_llist->qf_refcount++;
661         }
662   
663         if (qf_buf != NULL)
664             /* Use the existing quickfix buffer */
665             (void)do_ecmd(qf_buf->b_fnum, NULL, NULL, NULL, ECMD_ONE,
666 !                                                    ECMD_HIDE + ECMD_OLDBUF);
667         else
668         {
669             /* Create a new quickfix buffer */
670 !           (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE);
671             /* switch off 'swapfile' */
672             set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
673             set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
674 --- 2329,2344 ----
675             win->w_llist->qf_refcount++;
676         }
677   
678 +       if (oldwin != curwin)
679 +           oldwin = NULL;  /* don't store info when in another window */
680         if (qf_buf != NULL)
681             /* Use the existing quickfix buffer */
682             (void)do_ecmd(qf_buf->b_fnum, NULL, NULL, NULL, ECMD_ONE,
683 !                                            ECMD_HIDE + ECMD_OLDBUF, oldwin);
684         else
685         {
686             /* Create a new quickfix buffer */
687 !           (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, oldwin);
688             /* switch off 'swapfile' */
689             set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
690             set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
691 *** ../vim-7.2.040/src/window.c Wed Aug  6 18:32:11 2008
692 --- src/window.c        Wed Nov 12 18:12:37 2008
693 ***************
694 *** 531,537 ****
695   # ifdef FEAT_SCROLLBIND
696                         curwin->w_p_scb = FALSE;
697   # endif
698 !                       (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL, ECMD_HIDE);
699                         if (nchar == 'F' && lnum >= 0)
700                         {
701                             curwin->w_cursor.lnum = lnum;
702 --- 531,538 ----
703   # ifdef FEAT_SCROLLBIND
704                         curwin->w_p_scb = FALSE;
705   # endif
706 !                       (void)do_ecmd(0, ptr, NULL, NULL, ECMD_LASTL,
707 !                                                          ECMD_HIDE, NULL);
708                         if (nchar == 'F' && lnum >= 0)
709                         {
710                             curwin->w_cursor.lnum = lnum;
711 *** ../vim-7.2.040/src/version.c        Wed Nov 12 16:04:43 2008
712 --- src/version.c       Wed Nov 12 16:54:35 2008
713 ***************
714 *** 678,679 ****
715 --- 678,681 ----
716   {   /* Add new patch number below this line */
717 + /**/
718 +     41,
719   /**/
720
721 -- 
722 hundred-and-one symptoms of being an internet addict:
723 260. Co-workers have to E-mail you about the fire alarm to get
724      you out of the building.
725
726  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
727 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
728 \\\        download, build and distribute -- http://www.A-A-P.org        ///
729  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.078819 seconds and 3 git commands to generate.