aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index d152dfa271..4b9ef5d819 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -6057,8 +6057,10 @@ static int open_cmdwin(void)
curbuf->b_p_ma = true;
curwin->w_p_fen = false;
- /* Do execute autocommands for setting the filetype (load syntax). */
+ // Do execute autocommands for setting the filetype (load syntax).
unblock_autocmds();
+ // But don't allow switching to another buffer.
+ curbuf_lock++;
/* Showing the prompt may have set need_wait_return, reset it. */
need_wait_return = FALSE;
@@ -6071,6 +6073,7 @@ static int open_cmdwin(void)
}
set_option_value("ft", 0L, "vim", OPT_LOCAL);
}
+ curbuf_lock--;
/* Reset 'textwidth' after setting 'filetype' (the Vim filetype plugin
* sets 'textwidth' to 78). */