diff options
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index ff915173f7..079dcf10e9 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -2473,6 +2473,7 @@ theend: * ECMD_FORCEIT: ! used for Ex command * ECMD_ADDBUF: don't edit, just add to buffer list * ECMD_ALTBUF: like ECMD_ADDBUF and also set the alternate file + * ECMD_NOWINENTER: Do not trigger BufWinEnter * oldwin: Should be "curwin" when editing a new buffer in the current * window, NULL when splitting the window first. When not NULL info * of the previous buffer for "oldwin" is stored. @@ -3030,6 +3031,8 @@ do_ecmd( /* * Open the buffer and read the file. */ + if (flags & ECMD_NOWINENTER) + readfile_flags |= READ_NOWINENTER; #if defined(FEAT_EVAL) if (should_abort(open_buffer(FALSE, eap, readfile_flags))) retval = FAIL; @@ -3051,10 +3054,11 @@ do_ecmd( // changed by the user. do_modelines(OPT_WINONLY); - apply_autocmds_retval(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf, - &retval); - apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf, - &retval); + apply_autocmds_retval(EVENT_BUFENTER, NULL, NULL, FALSE, + curbuf, &retval); + if ((flags & ECMD_NOWINENTER) == 0) + apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, FALSE, + curbuf, &retval); } check_arg_idx(curwin); |