4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: "vim -o a b" when file "a" triggers the ATTENTION dialog,
12 selecting "Quit" exits Vim instead of editing "b" only.
13 When file "b" triggers the ATTENTION dialog selecting "Quit" or
14 "Abort" results in editing file "a" in that window.
15 Solution: When selecting "Abort" exit Vim. When selecting "Quit" close the
16 window. Also avoid hit-enter prompt when selecting Abort.
17 Files: src/buffer.c, src/main.c
20 *** ../vim-7.0.161/src/buffer.c Fri Oct 20 20:15:05 2006
21 --- src/buffer.c Tue Nov 7 21:08:02 2006
25 /* Use the name from the associated buffer if it exists. */
26 bp = buflist_findnr(aep->ae_fnum);
33 /* Use the name from the associated buffer if it exists. */
34 bp = buflist_findnr(aep->ae_fnum);
35 ! if (bp == NULL || bp->b_fname == NULL)
39 *** ../vim-7.0.161/src/main.c Tue Sep 5 12:57:14 2006
40 --- src/main.c Tue Nov 7 22:35:49 2006
43 (void)open_buffer(FALSE, NULL); /* create memfile, read file */
45 #if defined(HAS_SWAP_EXISTS_ACTION)
46 ! check_swap_exists_action();
49 dorewind = TRUE; /* start again */
51 (void)open_buffer(FALSE, NULL); /* create memfile, read file */
53 #if defined(HAS_SWAP_EXISTS_ACTION)
54 ! if (swap_exists_action == SEA_QUIT)
56 ! if (got_int || only_one_window())
58 ! /* abort selected or quit and only one window */
59 ! did_emsg = FALSE; /* avoid hit-enter prompt */
62 ! /* We can't close the window, it would disturb what
63 ! * happens next. Clear the file name and set the arg
64 ! * index to -1 to delete it later. */
65 ! setfname(curbuf, NULL, NULL, FALSE);
66 ! curwin->w_arg_idx = -1;
67 ! swap_exists_action = SEA_NONE;
70 ! handle_swap_exists(NULL);
73 dorewind = TRUE; /* start again */
78 int arg_idx; /* index in argument list */
91 for (i = 1; i < parmp->window_count; ++i)
93 ! if (parmp->window_layout == WIN_TABS)
95 ! if (curtab->tp_next == NULL) /* just checking */
101 ! if (curwin->w_next == NULL) /* just checking */
103 ! win_enter(curwin->w_next, FALSE);
106 /* Only open the file if there is no file in this window yet (that can
107 ! * happen when .vimrc contains ":sall") */
108 if (curbuf == firstwin->w_buffer || curbuf->b_ffname == NULL)
110 curwin->w_arg_idx = arg_idx;
111 ! /* edit file from arg list, if there is one */
112 (void)do_ecmd(0, arg_idx < GARGCOUNT
113 ? alist_name(&GARGLIST[arg_idx]) : NULL,
114 NULL, NULL, ECMD_LASTL, ECMD_HIDE);
115 if (arg_idx == GARGCOUNT - 1)
123 + /* When w_arg_idx is -1 remove the window (see create_windows()). */
124 + if (curwin->w_arg_idx == -1)
126 + win_close(curwin, TRUE);
131 for (i = 1; i < parmp->window_count; ++i)
133 ! /* When w_arg_idx is -1 remove the window (see create_windows()). */
134 ! if (curwin->w_arg_idx == -1)
137 ! win_close(curwin, TRUE);
144 ! if (parmp->window_layout == WIN_TABS)
146 ! if (curtab->tp_next == NULL) /* just checking */
152 ! if (curwin->w_next == NULL) /* just checking */
154 ! win_enter(curwin->w_next, FALSE);
159 /* Only open the file if there is no file in this window yet (that can
160 ! * happen when .vimrc contains ":sall"). */
161 if (curbuf == firstwin->w_buffer || curbuf->b_ffname == NULL)
163 curwin->w_arg_idx = arg_idx;
164 ! /* Edit file from arg list, if there is one. When "Quit" selected
165 ! * at the ATTENTION prompt close the window. */
166 ! old_curbuf = curbuf;
167 (void)do_ecmd(0, arg_idx < GARGCOUNT
168 ? alist_name(&GARGLIST[arg_idx]) : NULL,
169 NULL, NULL, ECMD_LASTL, ECMD_HIDE);
170 + if (curbuf == old_curbuf)
172 + if (got_int || only_one_window())
174 + /* abort selected or quit and only one window */
175 + did_emsg = FALSE; /* avoid hit-enter prompt */
178 + win_close(curwin, TRUE);
181 if (arg_idx == GARGCOUNT - 1)
184 *** ../vim-7.0.161/src/version.c Tue Nov 7 19:05:36 2006
185 --- src/version.c Tue Nov 7 21:21:28 2006
189 { /* Add new patch number below this line */
195 The CIA drives around in cars with the "Intel inside" logo.
197 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
198 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
199 \\\ download, build and distribute -- http://www.A-A-P.org ///
200 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///