]> git.pld-linux.org Git - packages/vim.git/blame - 7.0.147
- updated to 0.7.3
[packages/vim.git] / 7.0.147
CommitLineData
f3c378e8
AG
1To: vim-dev@vim.org
2Subject: Patch 7.0.147
3Fcc: outbox
4From: Bram Moolenaar <Bram@moolenaar.net>
5Mime-Version: 1.0
6Content-Type: text/plain; charset=ISO-8859-1
7Content-Transfer-Encoding: 8bit
8------------
9
10Patch 7.0.147
11Problem: When creating a session file and there are several tab pages and
12 some windows have a local directory a short file name may be used
13 when it's not valid. (Marius Roets)
14 A session with multiple tab pages may result in "No Name" buffers.
15 (Bill McCarthy)
16Solution: Don't enter tab pages when going through the list, only use a
17 pointer to the first window in each tab page.
18 Use "tabedit" instead of "tabnew | edit" when possible.
19Files: src/ex_docmd.c
20
21
22*** ../vim-7.0.146/src/ex_docmd.c Sun Sep 10 21:05:39 2006
23--- src/ex_docmd.c Tue Oct 24 12:55:11 2006
24***************
25*** 9643,9649 ****
26 #endif
27
28 #ifdef FEAT_SESSION
29! static int ses_winsizes __ARGS((FILE *fd, int restore_size));
30 static int ses_win_rec __ARGS((FILE *fd, frame_T *fr));
31 static frame_T *ses_skipframe __ARGS((frame_T *fr));
32 static int ses_do_frame __ARGS((frame_T *fr));
33--- 9643,9650 ----
34 #endif
35
36 #ifdef FEAT_SESSION
37! static int ses_winsizes __ARGS((FILE *fd, int restore_size,
38! win_T *tab_firstwin));
39 static int ses_win_rec __ARGS((FILE *fd, frame_T *fr));
40 static frame_T *ses_skipframe __ARGS((frame_T *fr));
41 static int ses_do_frame __ARGS((frame_T *fr));
42***************
43*** 9669,9676 ****
44 win_T *wp;
45 char_u *sname;
46 win_T *edited_win = NULL;
47- tabpage_T *old_curtab = curtab;
48 int tabnr;
49
50 if (ssop_flags & SSOP_BUFFERS)
51 only_save_windows = FALSE; /* Save ALL buffers */
52--- 9670,9677 ----
53 win_T *wp;
54 char_u *sname;
55 win_T *edited_win = NULL;
56 int tabnr;
57+ win_T *tab_firstwin;
58
59 if (ssop_flags & SSOP_BUFFERS)
60 only_save_windows = FALSE; /* Save ALL buffers */
61***************
62*** 9778,9791 ****
63 /*
64 * May repeat putting Windows for each tab, when "tabpages" is in
65 * 'sessionoptions'.
66 */
67 for (tabnr = 1; ; ++tabnr)
68 {
69 if ((ssop_flags & SSOP_TABPAGES))
70 {
71! goto_tabpage(tabnr);
72! if (tabnr > 1 && put_line(fd, "tabnew") == FAIL)
73! return FAIL;
74 }
75
76 /*
77--- 9779,9804 ----
78 /*
79 * May repeat putting Windows for each tab, when "tabpages" is in
80 * 'sessionoptions'.
81+ * Don't use goto_tabpage(), it may change directory and trigger
82+ * autocommands.
83 */
84+ tab_firstwin = firstwin; /* first window in tab page "tabnr" */
85 for (tabnr = 1; ; ++tabnr)
86 {
87+ int need_tabnew = FALSE;
88+
89 if ((ssop_flags & SSOP_TABPAGES))
90 {
91! tabpage_T *tp = find_tabpage(tabnr);
92!
93! if (tp == NULL)
94! break; /* done all tab pages */
95! if (tp == curtab)
96! tab_firstwin = firstwin;
97! else
98! tab_firstwin = tp->tp_firstwin;
99! if (tabnr > 1)
100! need_tabnew = TRUE;
101 }
102
103 /*
104***************
105*** 9793,9799 ****
106 * is aborted we don't end up with a number of useless windows.
107 * This may have side effects! (e.g., compressed or network file).
108 */
109! for (wp = firstwin; wp != NULL; wp = wp->w_next)
110 {
111 if (ses_do_win(wp)
112 && wp->w_buffer->b_ffname != NULL
113--- 9806,9812 ----
114 * is aborted we don't end up with a number of useless windows.
115 * This may have side effects! (e.g., compressed or network file).
116 */
117! for (wp = tab_firstwin; wp != NULL; wp = wp->w_next)
118 {
119 if (ses_do_win(wp)
120 && wp->w_buffer->b_ffname != NULL
121***************
122*** 9803,9817 ****
123 #endif
124 )
125 {
126! if (fputs("edit ", fd) < 0
127 || ses_fname(fd, wp->w_buffer, &ssop_flags) == FAIL)
128 return FAIL;
129 if (!wp->w_arg_idx_invalid)
130 edited_win = wp;
131 break;
132 }
133 }
134
135 /*
136 * Save current window layout.
137 */
138--- 9816,9835 ----
139 #endif
140 )
141 {
142! if (fputs(need_tabnew ? "tabedit " : "edit ", fd) < 0
143 || ses_fname(fd, wp->w_buffer, &ssop_flags) == FAIL)
144 return FAIL;
145+ need_tabnew = FALSE;
146 if (!wp->w_arg_idx_invalid)
147 edited_win = wp;
148 break;
149 }
150 }
151
152+ /* If no file got edited create an empty tab page. */
153+ if (need_tabnew && put_line(fd, "tabnew") == FAIL)
154+ return FAIL;
155+
156 /*
157 * Save current window layout.
158 */
159***************
160*** 9829,9835 ****
161 * Remember the window number of the current window after restoring.
162 */
163 nr = 0;
164! for (wp = firstwin; wp != NULL; wp = W_NEXT(wp))
165 {
166 if (ses_do_win(wp))
167 ++nr;
168--- 9847,9853 ----
169 * Remember the window number of the current window after restoring.
170 */
171 nr = 0;
172! for (wp = tab_firstwin; wp != NULL; wp = W_NEXT(wp))
173 {
174 if (ses_do_win(wp))
175 ++nr;
176***************
177*** 9852,9864 ****
178 */
179 if (put_line(fd, "set winheight=1 winwidth=1") == FAIL)
180 return FAIL;
181! if (nr > 1 && ses_winsizes(fd, restore_size) == FAIL)
182 return FAIL;
183
184 /*
185 * Restore the view of the window (options, file, cursor, etc.).
186 */
187! for (wp = firstwin; wp != NULL; wp = wp->w_next)
188 {
189 if (!ses_do_win(wp))
190 continue;
191--- 9870,9882 ----
192 */
193 if (put_line(fd, "set winheight=1 winwidth=1") == FAIL)
194 return FAIL;
195! if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
196 return FAIL;
197
198 /*
199 * Restore the view of the window (options, file, cursor, etc.).
200 */
201! for (wp = tab_firstwin; wp != NULL; wp = wp->w_next)
202 {
203 if (!ses_do_win(wp))
204 continue;
205***************
206*** 9879,9897 ****
207 * Restore window sizes again after jumping around in windows, because
208 * the current window has a minimum size while others may not.
209 */
210! if (nr > 1 && ses_winsizes(fd, restore_size) == FAIL)
211 return FAIL;
212
213 /* Don't continue in another tab page when doing only the current one
214 * or when at the last tab page. */
215! if (!(ssop_flags & SSOP_TABPAGES) || curtab->tp_next == NULL)
216 break;
217 }
218
219 if (ssop_flags & SSOP_TABPAGES)
220 {
221- if (valid_tabpage(old_curtab))
222- goto_tabpage_tp(old_curtab);
223 if (fprintf(fd, "tabnext %d", tabpage_index(curtab)) < 0
224 || put_eol(fd) == FAIL)
225 return FAIL;
226--- 9897,9913 ----
227 * Restore window sizes again after jumping around in windows, because
228 * the current window has a minimum size while others may not.
229 */
230! if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
231 return FAIL;
232
233 /* Don't continue in another tab page when doing only the current one
234 * or when at the last tab page. */
235! if (!(ssop_flags & SSOP_TABPAGES))
236 break;
237 }
238
239 if (ssop_flags & SSOP_TABPAGES)
240 {
241 if (fprintf(fd, "tabnext %d", tabpage_index(curtab)) < 0
242 || put_eol(fd) == FAIL)
243 return FAIL;
244***************
245*** 9927,9942 ****
246 }
247
248 static int
249! ses_winsizes(fd, restore_size)
250 FILE *fd;
251 int restore_size;
252 {
253 int n = 0;
254 win_T *wp;
255
256 if (restore_size && (ssop_flags & SSOP_WINSIZE))
257 {
258! for (wp = firstwin; wp != NULL; wp = wp->w_next)
259 {
260 if (!ses_do_win(wp))
261 continue;
262--- 9943,9959 ----
263 }
264
265 static int
266! ses_winsizes(fd, restore_size, tab_firstwin)
267 FILE *fd;
268 int restore_size;
269+ win_T *tab_firstwin;
270 {
271 int n = 0;
272 win_T *wp;
273
274 if (restore_size && (ssop_flags & SSOP_WINSIZE))
275 {
276! for (wp = tab_firstwin; wp != NULL; wp = wp->w_next)
277 {
278 if (!ses_do_win(wp))
279 continue;
280*** ../vim-7.0.146/src/version.c Fri Oct 20 20:15:05 2006
281--- src/version.c Tue Oct 24 12:57:04 2006
282***************
283*** 668,669 ****
284--- 668,671 ----
285 { /* Add new patch number below this line */
286+ /**/
287+ 147,
288 /**/
289
290--
291hundred-and-one symptoms of being an internet addict:
29295. Only communication in your household is through email.
293
294 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
295/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
296\\\ download, build and distribute -- http://www.A-A-P.org ///
297 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
This page took 0.067439 seconds and 4 git commands to generate.