summaryrefslogtreecommitdiffstats
path: root/src/arglist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arglist.c')
-rw-r--r--src/arglist.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/arglist.c b/src/arglist.c
index d28b31d..187e16e 100644
--- a/src/arglist.c
+++ b/src/arglist.c
@@ -502,7 +502,7 @@ do_arglist(
void
set_arglist(char_u *str)
{
- do_arglist(str, AL_SET, 0, FALSE);
+ do_arglist(str, AL_SET, 0, TRUE);
}
/*
@@ -682,6 +682,7 @@ do_argfile(exarg_T *eap, int argn)
int other;
char_u *p;
int old_arg_idx = curwin->w_arg_idx;
+ int is_split_cmd = *eap->cmd == 's';
if (ERROR_IF_ANY_POPUP_WINDOW)
return;
@@ -697,13 +698,18 @@ do_argfile(exarg_T *eap, int argn)
return;
}
+ if (!is_split_cmd
+ && (&ARGLIST[argn])->ae_fnum != curbuf->b_fnum
+ && !check_can_set_curbuf_forceit(eap->forceit))
+ return;
+
setpcmark();
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
#endif
// split window or create new tab page first
- if (*eap->cmd == 's' || cmdmod.cmod_tab != 0)
+ if (is_split_cmd || cmdmod.cmod_tab != 0)
{
if (win_split(0, 0) == FAIL)
return;
@@ -1253,10 +1259,6 @@ do_arg_all(
// When the ":tab" modifier was used do this for all tab pages.
arg_all_close_unused_windows(&aall);
- // Now set the last used tabpage to where we started.
- if (valid_tabpage(new_lu_tp))
- lastused_tabpage = new_lu_tp;
-
// Open a window for files in the argument list that don't have one.
// ARGCOUNT may change while doing this, because of autocommands.
if (count > aall.opened_len || count <= 0)
@@ -1291,6 +1293,11 @@ do_arg_all(
// to window with first arg
if (valid_tabpage(aall.new_curtab))
goto_tabpage_tp(aall.new_curtab, TRUE, TRUE);
+
+ // Now set the last used tabpage to where we started.
+ if (valid_tabpage(new_lu_tp))
+ lastused_tabpage = new_lu_tp;
+
if (win_valid(aall.new_curwin))
win_enter(aall.new_curwin, FALSE);