summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-10-20 21:58:42 +0100
committerBram Moolenaar <Bram@vim.org>2021-10-20 21:58:42 +0100
commit1d30fde3c989a962e0e1af4cbcf90e1ea483f1f4 (patch)
tree138c81443921e31b93299222af015755ed61404e /src/ex_cmds.c
parent09f7723d5a8694889350b13e3f6b4a9c3ed4c41f (diff)
patch 8.2.3547: opening the quickfix window triggers BufWinEnter twicev8.2.3547
Problem: Opening the quickfix window triggers BufWinEnter twice. (Yorick Peterse) Solution: Only trigger BufWinEnter with "quickfix". (closes #9022)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c12
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);