From 2182cd6081af283d3f08c434d00cc634b492033e Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Wed, 30 Sep 2015 10:34:22 -0300 Subject: ex_docmd: Fix terminal mode check condition for ex_normal Using the `curbuf->terminal` condition alone is wrong since it does not necessarily mean nvim is in terminal mode. It needs to be used with `State & TERM_FOCUS` because the current buffer could have changed without `terminal_enter` exiting. Close #3403 --- src/nvim/ex_docmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 3c09a3a2f8..f7162896ff 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -7624,7 +7624,7 @@ void update_topline_cursor(void) */ static void ex_normal(exarg_T *eap) { - if (curbuf->terminal) { + if (curbuf->terminal && State & TERM_FOCUS) { EMSG("Can't re-enter normal mode from terminal mode"); return; } -- cgit