4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When using tab pages and an argument list the session file may
12 contain wrong "next" commands. (Alexander Bluem)
13 Solution: Use "argu" commands and only when needed.
17 *** ../vim-7.1.181/src/ex_docmd.c Sun Dec 9 19:37:37 2007
18 --- src/ex_docmd.c Mon Dec 31 18:24:16 2007
21 static char_u *arg_all __ARGS((void));
23 static int makeopens __ARGS((FILE *fd, char_u *dirnow));
24 ! static int put_view __ARGS((FILE *fd, win_T *wp, int add_edit, unsigned *flagp));
25 static void ex_loadview __ARGS((exarg_T *eap));
26 static char_u *get_view_file __ARGS((int c));
27 static int did_lcd; /* whether ":lcd" was produced for a session */
29 static char_u *arg_all __ARGS((void));
31 static int makeopens __ARGS((FILE *fd, char_u *dirnow));
32 ! static int put_view __ARGS((FILE *fd, win_T *wp, int add_edit, unsigned *flagp, int current_arg_idx));
33 static void ex_loadview __ARGS((exarg_T *eap));
34 static char_u *get_view_file __ARGS((int c));
35 static int did_lcd; /* whether ":lcd" was produced for a session */
41 ! failed |= (put_view(fd, curwin, !using_vdir, flagp) == FAIL);
43 if (put_line(fd, "let &so = s:so_save | let &siso = s:siso_save")
49 ! failed |= (put_view(fd, curwin, !using_vdir, flagp,
52 if (put_line(fd, "let &so = s:so_save | let &siso = s:siso_save")
59 frame_T *tab_topframe;
60 + int cur_arg_idx = 0;
63 if (ssop_flags & SSOP_BUFFERS)
64 only_save_windows = FALSE; /* Save ALL buffers */
70 ! if (put_view(fd, wp, wp != edited_win, &ssop_flags) == FAIL)
72 if (nr > 1 && put_line(fd, "wincmd w") == FAIL)
77 * Restore cursor to the current window if it's not the first one.
83 ! if (put_view(fd, wp, wp != edited_win, &ssop_flags,
84 ! cur_arg_idx) == FAIL)
86 if (nr > 1 && put_line(fd, "wincmd w") == FAIL)
88 + next_arg_idx = wp->w_arg_idx;
91 + /* The argument index in the first tab page is zero, need to set it in
92 + * each window. For further tab pages it's the window where we do
94 + cur_arg_idx = next_arg_idx;
97 * Restore cursor to the current window if it's not the first one.
101 * Caller must make sure 'scrolloff' is zero.
104 ! put_view(fd, wp, add_edit, flagp)
107 int add_edit; /* add ":edit" command to view */
108 unsigned *flagp; /* vop_flags or ssop_flags */
113 * Caller must make sure 'scrolloff' is zero.
116 ! put_view(fd, wp, add_edit, flagp, current_arg_idx)
119 int add_edit; /* add ":edit" command to view */
120 unsigned *flagp; /* vop_flags or ssop_flags */
121 + int current_arg_idx; /* current argument index of the window, use
129 /* Only when part of a session: restore the argument index. Some
130 * arguments may have been deleted, check if the index is valid. */
131 ! if (wp->w_arg_idx != 0 && wp->w_arg_idx <= WARGCOUNT(wp)
132 && flagp == &ssop_flags)
134 ! if (fprintf(fd, "%ldnext", (long)wp->w_arg_idx) < 0
135 || put_eol(fd) == FAIL)
140 /* Only when part of a session: restore the argument index. Some
141 * arguments may have been deleted, check if the index is valid. */
142 ! if (wp->w_arg_idx != current_arg_idx && wp->w_arg_idx <= WARGCOUNT(wp)
143 && flagp == &ssop_flags)
145 ! if (fprintf(fd, "%ldargu", (long)wp->w_arg_idx + 1) < 0
146 || put_eol(fd) == FAIL)
149 *** ../vim-7.1.181/src/version.c Wed Jan 2 13:58:17 2008
150 --- src/version.c Wed Jan 2 15:10:01 2008
154 { /* Add new patch number below this line */
160 You were lucky. We lived for three months in a brown paper bag in a
161 septic tank. We used to have to get up at six o'clock in the morning,
162 clean the bag, eat a crust of stale bread, go to work down mill for
163 fourteen hours a day week in-week out. When we got home, our Dad
164 would thrash us to sleep with his belt!
166 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
167 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
168 \\\ download, build and distribute -- http://www.A-A-P.org ///
169 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///