diff options
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index ae5c334592..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; @@ -3642,7 +3642,8 @@ const char * set_one_cmd_context( } else { if (strncmp(arg, "messages", p - arg) == 0 || strncmp(arg, "ctype", p - arg) == 0 - || strncmp(arg, "time", p - arg) == 0) { + || strncmp(arg, "time", p - arg) == 0 + || strncmp(arg, "collate", p - arg) == 0) { xp->xp_context = EXPAND_LOCALES; xp->xp_pattern = skipwhite((const char_u *)p); } else { @@ -6519,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) { @@ -6588,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); @@ -7303,7 +7307,8 @@ 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" */ if (global_busy) { |