aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-09-30 10:34:22 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-10-01 15:22:49 -0300
commit2182cd6081af283d3f08c434d00cc634b492033e (patch)
treed9742ca2e11224a189d5411a278619ef084fb7e5
parent0ca3f03c19287cf03b53775aadaf1c18071bba87 (diff)
downloadrneovim-2182cd6081af283d3f08c434d00cc634b492033e.tar.gz
rneovim-2182cd6081af283d3f08c434d00cc634b492033e.tar.bz2
rneovim-2182cd6081af283d3f08c434d00cc634b492033e.zip
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
-rw-r--r--src/nvim/ex_docmd.c2
1 files changed, 1 insertions, 1 deletions
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;
}