terminal: preserve mode when using <Cmd>wincmd in terminal mode (#12254)

This commit is contained in:
Ghjuvan Lacambre
2020-06-22 23:22:58 +02:00
committed by GitHub
parent 1619410a05
commit 721f69c4af
2 changed files with 21 additions and 1 deletions

View File

@@ -489,7 +489,17 @@ static int terminal_execute(VimState *state, int key)
terminal_send_key(s->term, key);
}
return curbuf->handle == s->term->buf_handle;
if (curbuf->terminal == NULL) {
return 0;
}
if (s->term != curbuf->terminal) {
invalidate_terminal(s->term, s->term->cursor.row, s->term->cursor.row + 1);
invalidate_terminal(curbuf->terminal,
curbuf->terminal->cursor.row,
curbuf->terminal->cursor.row + 1);
s->term = curbuf->terminal;
}
return 1;
}
void terminal_destroy(Terminal *term)