]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.557
- up to 7.3.600
[packages/vim.git] / 7.3.557
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.557
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.3.557
11 Problem:    Crash when an autocommand wipes out a buffer when it is hidden.
12 Solution:   Restore the current window when needed. (Christian Brabandt)
13 Files:      src/buffer.c
14
15
16 *** ../vim-7.3.556/src/buffer.c 2012-06-13 14:28:16.000000000 +0200
17 --- src/buffer.c        2012-06-20 11:49:54.000000000 +0200
18 ***************
19 *** 1363,1368 ****
20 --- 1363,1369 ----
21       int               action;
22   {
23       buf_T     *prevbuf;
24 +     win_T     *prevwin;
25       int               unload = (action == DOBUF_UNLOAD || action == DOBUF_DEL
26                                                      || action == DOBUF_WIPE);
27   
28 ***************
29 *** 1402,1423 ****
30         if (buf_valid(prevbuf))
31   #endif
32         {
33             if (prevbuf == curbuf)
34                 u_sync(FALSE);
35             close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
36                     unload ? action : (action == DOBUF_GOTO
37                         && !P_HID(prevbuf)
38                         && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
39         }
40       }
41   #ifdef FEAT_AUTOCMD
42       /* An autocommand may have deleted "buf", already entered it (e.g., when
43 !      * it did ":bunload") or aborted the script processing! */
44 ! # ifdef FEAT_EVAL
45 !     if (buf_valid(buf) && buf != curbuf && !aborting())
46 ! # else
47 !     if (buf_valid(buf) && buf != curbuf)
48 ! # endif
49   #endif
50         enter_buffer(buf);
51   }
52 --- 1403,1432 ----
53         if (buf_valid(prevbuf))
54   #endif
55         {
56 +           prevwin = curwin;
57             if (prevbuf == curbuf)
58                 u_sync(FALSE);
59             close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
60                     unload ? action : (action == DOBUF_GOTO
61                         && !P_HID(prevbuf)
62                         && !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
63 +           if (curwin != prevwin && win_valid(prevwin))
64 +             /* autocommands changed curwin, Grr! */
65 +             curwin = prevwin;
66         }
67       }
68   #ifdef FEAT_AUTOCMD
69       /* An autocommand may have deleted "buf", already entered it (e.g., when
70 !      * it did ":bunload") or aborted the script processing!
71 !      * If curwin->w_buffer is null, enter_buffer() will make it valid again */
72 !     if ((buf_valid(buf) && buf != curbuf
73 ! #ifdef FEAT_EVAL
74 !           && !aborting()
75 ! #endif
76 ! #ifdef FEAT_WINDOWS
77 !        ) || curwin->w_buffer == NULL
78 ! #endif
79 !        )
80   #endif
81         enter_buffer(buf);
82   }
83 *** ../vim-7.3.556/src/version.c        2012-06-14 20:59:20.000000000 +0200
84 --- src/version.c       2012-06-20 11:53:56.000000000 +0200
85 ***************
86 *** 716,717 ****
87 --- 716,719 ----
88   {   /* Add new patch number below this line */
89 + /**/
90 +     557,
91   /**/
92
93 -- 
94 Don't read everything you believe.
95
96  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
97 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
98 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
99  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.032671 seconds and 3 git commands to generate.