terminal: preserve mode when using <Cmd>wincmd in terminal mode (#12254)
This commit is contained in:
parent
1619410a05
commit
721f69c4af
|
@ -489,7 +489,17 @@ static int terminal_execute(VimState *state, int key)
|
||||||
terminal_send_key(s->term, 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)
|
void terminal_destroy(Terminal *term)
|
||||||
|
|
|
@ -103,4 +103,14 @@ describe(':terminal', function()
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('stays in terminal mode with <Cmd>wincmd', function()
|
||||||
|
command('terminal')
|
||||||
|
command('split')
|
||||||
|
command('terminal')
|
||||||
|
feed('a<Cmd>wincmd j<CR>')
|
||||||
|
eq(2, eval("winnr()"))
|
||||||
|
eq('t', eval('mode()'))
|
||||||
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue