diff options
author | Bram Moolenaar <Bram@vim.org> | 2004-09-02 19:12:26 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2004-09-02 19:12:26 +0000 |
commit | d4755bb0e04fca334675f1503bd6474b017a9bba (patch) | |
tree | 8be8df859191e78ee9eef80d3b341fd5d0c1b81b /src/ex_cmds2.c | |
parent | 269ec658f0fad22b2bf9f71b06a4e6e10277f0e5 (diff) | |
download | vim-git-d4755bb0e04fca334675f1503bd6474b017a9bba.tar.gz |
updated for version 7.0014
Diffstat (limited to 'src/ex_cmds2.c')
-rw-r--r-- | src/ex_cmds2.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index b651f34a7..1e2584159 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1062,6 +1062,7 @@ do_one_arg(str) static int do_arglist __ARGS((char_u *str, int what, int after)); static void alist_check_arg_idx __ARGS((void)); +static int editing_arg_idx __ARGS((win_T *win)); #ifdef FEAT_LISTCMDS static int alist_add_list __ARGS((int count, char_u **files, int after)); #endif @@ -1221,20 +1222,30 @@ alist_check_arg_idx() } /* - * Check if window "win" is editing the w_arg_idx file in its argument list. + * Return TRUE if window "win" is editing then file at the current argument + * index. */ - void -check_arg_idx(win) + static int +editing_arg_idx(win) win_T *win; { - if (WARGCOUNT(win) > 1 - && (win->w_arg_idx >= WARGCOUNT(win) + return !(win->w_arg_idx >= WARGCOUNT(win) || (win->w_buffer->b_fnum != WARGLIST(win)[win->w_arg_idx].ae_fnum && (win->w_buffer->b_ffname == NULL || !(fullpathcmp( alist_name(&WARGLIST(win)[win->w_arg_idx]), - win->w_buffer->b_ffname, TRUE) & FPC_SAME))))) + win->w_buffer->b_ffname, TRUE) & FPC_SAME)))); +} + +/* + * Check if window "win" is editing the w_arg_idx file in its argument list. + */ + void +check_arg_idx(win) + win_T *win; +{ + if (WARGCOUNT(win) > 1 && !editing_arg_idx(win)) { /* We are not editing the current entry in the argument list. * Set "arg_had_last" if we are editing the last one. */ @@ -1662,7 +1673,7 @@ ex_listdo(eap) break; /* Don't call do_argfile() when already there, it will try * reloading the file. */ - if (curwin->w_arg_idx != i) + if (curwin->w_arg_idx != i || !editing_arg_idx(curwin)) do_argfile(eap, i); if (curwin->w_arg_idx != i) break; |