Mirror of the Vim source from https://github.com/vim/vim
Revisión | 198ea7a9c633089ef2638513d05611a9d1b6e39c (tree) |
---|---|
Tiempo | 2008-01-02 23:13:10 |
Autor | vimboss |
Commiter | vimboss |
updated for version 7.1-182
@@ -372,7 +372,7 @@ | ||
372 | 372 | static char_u *arg_all __ARGS((void)); |
373 | 373 | #ifdef FEAT_SESSION |
374 | 374 | static int makeopens __ARGS((FILE *fd, char_u *dirnow)); |
375 | -static int put_view __ARGS((FILE *fd, win_T *wp, int add_edit, unsigned *flagp)); | |
375 | +static int put_view __ARGS((FILE *fd, win_T *wp, int add_edit, unsigned *flagp, int current_arg_idx)); | |
376 | 376 | static void ex_loadview __ARGS((exarg_T *eap)); |
377 | 377 | static char_u *get_view_file __ARGS((int c)); |
378 | 378 | static int did_lcd; /* whether ":lcd" was produced for a session */ |
@@ -8762,7 +8762,8 @@ | ||
8762 | 8762 | } |
8763 | 8763 | else |
8764 | 8764 | { |
8765 | - failed |= (put_view(fd, curwin, !using_vdir, flagp) == FAIL); | |
8765 | + failed |= (put_view(fd, curwin, !using_vdir, flagp, | |
8766 | + -1) == FAIL); | |
8766 | 8767 | } |
8767 | 8768 | if (put_line(fd, "let &so = s:so_save | let &siso = s:siso_save") |
8768 | 8769 | == FAIL) |
@@ -9761,6 +9762,8 @@ | ||
9761 | 9762 | int tabnr; |
9762 | 9763 | win_T *tab_firstwin; |
9763 | 9764 | frame_T *tab_topframe; |
9765 | + int cur_arg_idx = 0; | |
9766 | + int next_arg_idx; | |
9764 | 9767 | |
9765 | 9768 | if (ssop_flags & SSOP_BUFFERS) |
9766 | 9769 | only_save_windows = FALSE; /* Save ALL buffers */ |
@@ -9976,11 +9979,18 @@ | ||
9976 | 9979 | { |
9977 | 9980 | if (!ses_do_win(wp)) |
9978 | 9981 | continue; |
9979 | - if (put_view(fd, wp, wp != edited_win, &ssop_flags) == FAIL) | |
9982 | + if (put_view(fd, wp, wp != edited_win, &ssop_flags, | |
9983 | + cur_arg_idx) == FAIL) | |
9980 | 9984 | return FAIL; |
9981 | 9985 | if (nr > 1 && put_line(fd, "wincmd w") == FAIL) |
9982 | 9986 | return FAIL; |
9983 | - } | |
9987 | + next_arg_idx = wp->w_arg_idx; | |
9988 | + } | |
9989 | + | |
9990 | + /* The argument index in the first tab page is zero, need to set it in | |
9991 | + * each window. For further tab pages it's the window where we do | |
9992 | + * "tabedit". */ | |
9993 | + cur_arg_idx = next_arg_idx; | |
9984 | 9994 | |
9985 | 9995 | /* |
9986 | 9996 | * Restore cursor to the current window if it's not the first one. |
@@ -10190,11 +10200,13 @@ | ||
10190 | 10200 | * Caller must make sure 'scrolloff' is zero. |
10191 | 10201 | */ |
10192 | 10202 | static int |
10193 | -put_view(fd, wp, add_edit, flagp) | |
10203 | +put_view(fd, wp, add_edit, flagp, current_arg_idx) | |
10194 | 10204 | FILE *fd; |
10195 | 10205 | win_T *wp; |
10196 | 10206 | int add_edit; /* add ":edit" command to view */ |
10197 | 10207 | unsigned *flagp; /* vop_flags or ssop_flags */ |
10208 | + int current_arg_idx; /* current argument index of the window, use | |
10209 | + * -1 if unknown */ | |
10198 | 10210 | { |
10199 | 10211 | win_T *save_curwin; |
10200 | 10212 | int f; |
@@ -10224,10 +10236,10 @@ | ||
10224 | 10236 | |
10225 | 10237 | /* Only when part of a session: restore the argument index. Some |
10226 | 10238 | * arguments may have been deleted, check if the index is valid. */ |
10227 | - if (wp->w_arg_idx != 0 && wp->w_arg_idx <= WARGCOUNT(wp) | |
10239 | + if (wp->w_arg_idx != current_arg_idx && wp->w_arg_idx <= WARGCOUNT(wp) | |
10228 | 10240 | && flagp == &ssop_flags) |
10229 | 10241 | { |
10230 | - if (fprintf(fd, "%ldnext", (long)wp->w_arg_idx) < 0 | |
10242 | + if (fprintf(fd, "%ldargu", (long)wp->w_arg_idx + 1) < 0 | |
10231 | 10243 | || put_eol(fd) == FAIL) |
10232 | 10244 | return FAIL; |
10233 | 10245 | did_next = TRUE; |
@@ -667,6 +667,8 @@ | ||
667 | 667 | static int included_patches[] = |
668 | 668 | { /* Add new patch number below this line */ |
669 | 669 | /**/ |
670 | + 182, | |
671 | +/**/ | |
670 | 672 | 181, |
671 | 673 | /**/ |
672 | 674 | 180, |