From 73392909006de74e628323cde915b107244a247b Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 11 May 2021 21:10:14 -0400 Subject: vim-patch:8.2.1000: get error when leaving Ex mode with :visual Problem: Get error when leaving Ex mode with :visual and a CmdLineEnter autocommand was used. Solution: Reset ex_pressedreturn. (closes vim/vim#6293) https://github.com/vim/vim/commit/158ea175a99fc23eae1b0a5ee9a81cdd973854a6 --- src/nvim/ex_docmd.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 555029c1fb..87e482620c 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -7305,6 +7305,7 @@ do_exedit( if (exmode_active && (eap->cmdidx == CMD_visual || eap->cmdidx == CMD_view)) { exmode_active = FALSE; + ex_pressedreturn = false; if (*eap->arg == NUL) { /* Special case: ":global/pat/visual\NLvi-commands" */ if (global_busy) { -- cgit From f54a938271a4006a05638956a46e0bbe114eedf7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Tue, 11 May 2021 21:20:32 -0400 Subject: 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 --- src/nvim/ex_docmd.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nvim/ex_docmd.c') 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) { -- cgit From 433807763236427cbe0ff347c1c5b77877aa0aff Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 12 May 2021 02:29:35 -0400 Subject: Revert "XXX: ex_tabonly(): aucmd_win is not part of the window list." This reverts commit 7214d0bc846179a862e8d3061d00270a6caa0d7b. Cannot test patch v8.2.1059 without reverting this commit. --- src/nvim/ex_docmd.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 1b44b92aa2..02bbc90858 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6595,9 +6595,6 @@ static void ex_tabonly(exarg_T *eap) // Repeat this up to a 1000 times, because autocommands may // mess up the lists. for (int done = 0; done < 1000; done++) { - FOR_ALL_TAB_WINDOWS(tp, wp) { - assert(wp != aucmd_win); - } FOR_ALL_TABS(tp) { if (tp->tp_topframe != topframe) { tabpage_close_other(tp, eap->forceit); -- cgit From e9804aead6adf1fb0e3d16d5544e82fc0e566890 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 12 May 2021 02:28:15 -0400 Subject: lint --- src/nvim/ex_docmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 02bbc90858..c557bb2438 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -212,7 +212,7 @@ void do_exmode(int improved) while (exmode_active) { /* Check for a ":normal" command and no more characters left. */ if (ex_normal_busy > 0 && typebuf.tb_len == 0) { - exmode_active = FALSE; + exmode_active = 0; break; } msg_scroll = true; @@ -7307,7 +7307,7 @@ do_exedit( */ if (exmode_active && (eap->cmdidx == CMD_visual || eap->cmdidx == CMD_view)) { - exmode_active = FALSE; + exmode_active = 0; ex_pressedreturn = false; if (*eap->arg == NUL) { /* Special case: ":global/pat/visual\NLvi-commands" */ -- cgit