diff options
author | Yorick Peterse <git@yorickpeterse.com> | 2021-10-24 03:55:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-23 21:55:04 -0400 |
commit | 6acebb8b56e21247423a5692e9ca30dff05abb63 (patch) | |
tree | a80bbc7097d0f33208008730fd7835006a231f92 /src/nvim/ex_cmds.c | |
parent | 9f392c071aab2e80bc0264f0665d048786cd2e1c (diff) | |
download | rneovim-6acebb8b56e21247423a5692e9ca30dff05abb63.tar.gz rneovim-6acebb8b56e21247423a5692e9ca30dff05abb63.tar.bz2 rneovim-6acebb8b56e21247423a5692e9ca30dff05abb63.zip |
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
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r-- | src/nvim/ex_cmds.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 36f8782fd7..558001cd62 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -2279,6 +2279,7 @@ theend: /// 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 /// @param 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. @@ -2735,7 +2736,10 @@ int do_ecmd(int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T new /* * Open the buffer and read the file. */ - if (should_abort(open_buffer(FALSE, eap, readfile_flags))) { + if (flags & ECMD_NOWINENTER) { + readfile_flags |= READ_NOWINENTER; + } + if (should_abort(open_buffer(false, eap, readfile_flags))) { retval = FAIL; } @@ -2751,8 +2755,10 @@ int do_ecmd(int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T new apply_autocmds_retval(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf, &retval); - apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, FALSE, curbuf, - &retval); + if ((flags & ECMD_NOWINENTER) == 0) { + apply_autocmds_retval(EVENT_BUFWINENTER, NULL, NULL, false, curbuf, + &retval); + } } check_arg_idx(curwin); |