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
This commit is contained in:
Thiago de Arruda 2015-09-30 10:34:22 -03:00
parent 0ca3f03c19
commit 2182cd6081

View File

@ -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;
}