From 6acebb8b56e21247423a5692e9ca30dff05abb63 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Sun, 24 Oct 2021 03:55:04 +0200 Subject: vim-patch:8.2.3547: opening the quickfix window triggers BufWinEnter twice (#16108) Problem: Opening the quickfix window triggers BufWinEnter twice. (Yorick Peterse) Solution: Only trigger BufWinEnter with "quickfix". (closes vim/vim#9022) https://github.com/vim/vim/commit/1d30fde3c989a962e0e1af4cbcf90e1ea483f1f4 --- src/nvim/buffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 9fbcb24298..37a2060021 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -325,8 +325,10 @@ int open_buffer(int read_stdin, exarg_T *eap, int flags) do_modelines(0); curbuf->b_flags &= ~(BF_CHECK_RO | BF_NEVERLOADED); - apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, false, curbuf, - &retval); + if ((flags & READ_NOWINENTER) == 0) { + apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, false, curbuf, + &retval); + } // restore curwin/curbuf and a few other things aucmd_restbuf(&aco); -- cgit