aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/ex_terminal_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-01-16 10:42:09 +0800
committerGitHub <noreply@github.com>2024-01-16 10:42:09 +0800
commit267e90f31d186cc06202f308e1a63fbcc6bbed2c (patch)
treebde7fcc1308098004691309ff4042f0330dbb7fc /test/functional/terminal/ex_terminal_spec.lua
parenta34451982fe661fcfb6082607a8cf4c22ff51577 (diff)
downloadrneovim-267e90f31d186cc06202f308e1a63fbcc6bbed2c.tar.gz
rneovim-267e90f31d186cc06202f308e1a63fbcc6bbed2c.tar.bz2
rneovim-267e90f31d186cc06202f308e1a63fbcc6bbed2c.zip
fix(edit): don't go to Terminal mode when stopping Insert mode (#27033)
Diffstat (limited to 'test/functional/terminal/ex_terminal_spec.lua')
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index 55ddfbab7b..0a1ba6d980 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -144,6 +144,15 @@ describe(':terminal', function()
eq({ blocking = false, mode = 't' }, api.nvim_get_mode())
eq({ 'InsertLeave', 'TermEnter' }, eval('g:events'))
end)
+
+ it('switching to terminal buffer immediately after :stopinsert #27031', function()
+ command('terminal')
+ command('vnew')
+ feed('i')
+ eq({ blocking = false, mode = 'i' }, api.nvim_get_mode())
+ command('stopinsert | wincmd p')
+ eq({ blocking = false, mode = 'nt' }, api.nvim_get_mode())
+ end)
end)
local function test_terminal_with_fake_shell(backslash)