diff options
Diffstat (limited to 'src/arglist.c')
-rw-r--r-- | src/arglist.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/src/arglist.c b/src/arglist.c index 6183fafff6..bb31c45e93 100644 --- a/src/arglist.c +++ b/src/arglist.c @@ -693,56 +693,56 @@ do_argfile(exarg_T *eap, int argn) emsg(_(e_cannot_go_before_first_file)); else emsg(_(e_cannot_go_beyond_last_file)); + + return; } - else - { - setpcmark(); + + setpcmark(); #ifdef FEAT_GUI - need_mouse_correct = TRUE; + need_mouse_correct = TRUE; #endif - // split window or create new tab page first - if (*eap->cmd == 's' || cmdmod.cmod_tab != 0) - { - if (win_split(0, 0) == FAIL) - return; - RESET_BINDING(curwin); - } - else + // split window or create new tab page first + if (*eap->cmd == 's' || cmdmod.cmod_tab != 0) + { + if (win_split(0, 0) == FAIL) + return; + RESET_BINDING(curwin); + } + else + { + // if 'hidden' set, only check for changed file when re-editing + // the same buffer + other = TRUE; + if (buf_hide(curbuf)) { - // if 'hidden' set, only check for changed file when re-editing - // the same buffer - other = TRUE; - if (buf_hide(curbuf)) - { - p = fix_fname(alist_name(&ARGLIST[argn])); - other = otherfile(p); - vim_free(p); - } - if ((!buf_hide(curbuf) || !other) - && check_changed(curbuf, CCGD_AW - | (other ? 0 : CCGD_MULTWIN) - | (eap->forceit ? CCGD_FORCEIT : 0) - | CCGD_EXCMD)) - return; + p = fix_fname(alist_name(&ARGLIST[argn])); + other = otherfile(p); + vim_free(p); } - - curwin->w_arg_idx = argn; - if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist) - arg_had_last = TRUE; - - // Edit the file; always use the last known line number. - // When it fails (e.g. Abort for already edited file) restore the - // argument index. - if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL, - eap, ECMD_LAST, - (buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0) - + (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL) - curwin->w_arg_idx = old_arg_idx; - // like Vi: set the mark where the cursor is in the file. - else if (eap->cmdidx != CMD_argdo) - setmark('\''); + if ((!buf_hide(curbuf) || !other) + && check_changed(curbuf, CCGD_AW + | (other ? 0 : CCGD_MULTWIN) + | (eap->forceit ? CCGD_FORCEIT : 0) + | CCGD_EXCMD)) + return; } + + curwin->w_arg_idx = argn; + if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist) + arg_had_last = TRUE; + + // Edit the file; always use the last known line number. + // When it fails (e.g. Abort for already edited file) restore the + // argument index. + if (do_ecmd(0, alist_name(&ARGLIST[curwin->w_arg_idx]), NULL, + eap, ECMD_LAST, + (buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0) + + (eap->forceit ? ECMD_FORCEIT : 0), curwin) == FAIL) + curwin->w_arg_idx = old_arg_idx; + // like Vi: set the mark where the cursor is in the file. + else if (eap->cmdidx != CMD_argdo) + setmark('\''); } /* |