diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-11 21:20:32 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-13 20:46:00 -0400 |
commit | f54a938271a4006a05638956a46e0bbe114eedf7 (patch) | |
tree | 1fbcf0320d046fc4622ac2fe8e407e6f34c65d70 /src/nvim/ex_docmd.c | |
parent | 73392909006de74e628323cde915b107244a247b (diff) | |
download | rneovim-f54a938271a4006a05638956a46e0bbe114eedf7.tar.gz rneovim-f54a938271a4006a05638956a46e0bbe114eedf7.tar.bz2 rneovim-f54a938271a4006a05638956a46e0bbe114eedf7.zip |
vim-patch:8.2.1059: crash when using :tabonly in an autocommand
Problem: Crash when using :tabonly in an autocommand. (Yegappan Lakshmanan)
Solution: Do not allow the autocommand window to be closed.
https://github.com/vim/vim/commit/cf8441704d6e517bda1899f4afa82c6b4eecbaec
E813 error message does not mention 'popup' window
because Neovim floating window are regular windows, unlike Vim popups.
https://github.com/neovim/neovim/pull/14532#discussion_r631731829
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 87e482620c..1b44b92aa2 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6520,6 +6520,12 @@ ex_win_close( int need_hide; buf_T *buf = win->w_buffer; + // Never close the autocommand window. + if (win == aucmd_win) { + EMSG(_(e_autocmd_close)); + return; + } + need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1); if (need_hide && !buf_hide(buf) && !forceit) { if ((p_confirm || cmdmod.confirm) && p_write) { |