]>
Commit | Line | Data |
---|---|---|
c84df032 ER |
1 | To: vim-dev@vim.org |
2 | Subject: Patch 7.0.162 | |
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.0.162 | |
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 | |
18 | ||
19 | ||
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 | |
22 | *************** | |
23 | *** 4220,4226 **** | |
24 | ||
25 | /* Use the name from the associated buffer if it exists. */ | |
26 | bp = buflist_findnr(aep->ae_fnum); | |
27 | ! if (bp == NULL) | |
28 | return aep->ae_fname; | |
29 | return bp->b_fname; | |
30 | } | |
31 | --- 4222,4228 ---- | |
32 | ||
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) | |
36 | return aep->ae_fname; | |
37 | return bp->b_fname; | |
38 | } | |
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 | |
41 | *************** | |
42 | *** 2392,2398 **** | |
43 | (void)open_buffer(FALSE, NULL); /* create memfile, read file */ | |
44 | ||
45 | #if defined(HAS_SWAP_EXISTS_ACTION) | |
46 | ! check_swap_exists_action(); | |
47 | #endif | |
48 | #ifdef FEAT_AUTOCMD | |
49 | dorewind = TRUE; /* start again */ | |
50 | --- 2392,2414 ---- | |
51 | (void)open_buffer(FALSE, NULL); /* create memfile, read file */ | |
52 | ||
53 | #if defined(HAS_SWAP_EXISTS_ACTION) | |
54 | ! if (swap_exists_action == SEA_QUIT) | |
55 | ! { | |
56 | ! if (got_int || only_one_window()) | |
57 | ! { | |
58 | ! /* abort selected or quit and only one window */ | |
59 | ! did_emsg = FALSE; /* avoid hit-enter prompt */ | |
60 | ! getout(1); | |
61 | ! } | |
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; | |
68 | ! } | |
69 | ! else | |
70 | ! handle_swap_exists(NULL); | |
71 | #endif | |
72 | #ifdef FEAT_AUTOCMD | |
73 | dorewind = TRUE; /* start again */ | |
74 | *************** | |
75 | *** 2432,2437 **** | |
76 | --- 2448,2455 ---- | |
77 | { | |
78 | int arg_idx; /* index in argument list */ | |
79 | int i; | |
80 | + int advance = TRUE; | |
81 | + buf_T *old_curbuf; | |
82 | ||
83 | # ifdef FEAT_AUTOCMD | |
84 | /* | |
85 | *************** | |
86 | *** 2440,2470 **** | |
87 | ++autocmd_no_enter; | |
88 | ++autocmd_no_leave; | |
89 | # endif | |
90 | arg_idx = 1; | |
91 | for (i = 1; i < parmp->window_count; ++i) | |
92 | { | |
93 | ! if (parmp->window_layout == WIN_TABS) | |
94 | { | |
95 | ! if (curtab->tp_next == NULL) /* just checking */ | |
96 | ! break; | |
97 | ! goto_tabpage(0); | |
98 | } | |
99 | ! else | |
100 | { | |
101 | ! if (curwin->w_next == NULL) /* just checking */ | |
102 | ! break; | |
103 | ! win_enter(curwin->w_next, FALSE); | |
104 | } | |
105 | ||
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) | |
109 | { | |
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) | |
116 | arg_had_last = TRUE; | |
117 | ++arg_idx; | |
118 | --- 2458,2522 ---- | |
119 | ++autocmd_no_enter; | |
120 | ++autocmd_no_leave; | |
121 | # endif | |
122 | + | |
123 | + /* When w_arg_idx is -1 remove the window (see create_windows()). */ | |
124 | + if (curwin->w_arg_idx == -1) | |
125 | + { | |
126 | + win_close(curwin, TRUE); | |
127 | + advance = FALSE; | |
128 | + } | |
129 | + | |
130 | arg_idx = 1; | |
131 | for (i = 1; i < parmp->window_count; ++i) | |
132 | { | |
133 | ! /* When w_arg_idx is -1 remove the window (see create_windows()). */ | |
134 | ! if (curwin->w_arg_idx == -1) | |
135 | { | |
136 | ! ++arg_idx; | |
137 | ! win_close(curwin, TRUE); | |
138 | ! advance = FALSE; | |
139 | ! continue; | |
140 | } | |
141 | ! | |
142 | ! if (advance) | |
143 | { | |
144 | ! if (parmp->window_layout == WIN_TABS) | |
145 | ! { | |
146 | ! if (curtab->tp_next == NULL) /* just checking */ | |
147 | ! break; | |
148 | ! goto_tabpage(0); | |
149 | ! } | |
150 | ! else | |
151 | ! { | |
152 | ! if (curwin->w_next == NULL) /* just checking */ | |
153 | ! break; | |
154 | ! win_enter(curwin->w_next, FALSE); | |
155 | ! } | |
156 | } | |
157 | + advance = TRUE; | |
158 | ||
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) | |
162 | { | |
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) | |
171 | + { | |
172 | + if (got_int || only_one_window()) | |
173 | + { | |
174 | + /* abort selected or quit and only one window */ | |
175 | + did_emsg = FALSE; /* avoid hit-enter prompt */ | |
176 | + getout(1); | |
177 | + } | |
178 | + win_close(curwin, TRUE); | |
179 | + advance = FALSE; | |
180 | + } | |
181 | if (arg_idx == GARGCOUNT - 1) | |
182 | arg_had_last = TRUE; | |
183 | ++arg_idx; | |
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 | |
186 | *************** | |
187 | *** 668,669 **** | |
188 | --- 668,671 ---- | |
189 | { /* Add new patch number below this line */ | |
190 | + /**/ | |
191 | + 162, | |
192 | /**/ | |
193 | ||
194 | -- | |
195 | The CIA drives around in cars with the "Intel inside" logo. | |
196 | ||
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 /// |