aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/terminal/buffer_spec.lua4
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua15
-rw-r--r--test/functional/terminal/mouse_spec.lua10
-rw-r--r--test/functional/terminal/window_split_tab_spec.lua2
4 files changed, 20 insertions, 11 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index 5442724644..7dcca231ee 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -24,11 +24,11 @@ describe(':terminal buffer', function()
feed([[<C-\><C-N>]])
command('setlocal cursorline cursorlineopt=both cursorcolumn scrolloff=4 sidescrolloff=7')
eq({ 'both', 1, 1, 4, 7 }, eval('[&l:cursorlineopt, &l:cursorline, &l:cursorcolumn, &l:scrolloff, &l:sidescrolloff]'))
- eq('n', eval('mode()'))
+ eq('nt', eval('mode(1)'))
-- Enter terminal-mode ("insert" mode in :terminal).
feed('i')
- eq('t', eval('mode()'))
+ eq('t', eval('mode(1)'))
eq({ 'number', 1, 0, 0, 0 }, eval('[&l:cursorlineopt, &l:cursorline, &l:cursorcolumn, &l:scrolloff, &l:sidescrolloff]'))
end)
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index 707c355069..065dd72485 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -96,19 +96,28 @@ describe(':terminal', function()
eq(3, #jumps)
end)
+ it('nvim_get_mode() in :terminal', function()
+ command(':terminal')
+ eq({ blocking=false, mode='nt' }, nvim('get_mode'))
+ feed('i')
+ eq({ blocking=false, mode='t' }, nvim('get_mode'))
+ feed([[<C-\><C-N>]])
+ eq({ blocking=false, mode='nt' }, nvim('get_mode'))
+ end)
+
it(':stopinsert RPC request exits terminal-mode #7807', function()
command(':terminal')
feed('i[tui] insert-mode')
eq({ blocking=false, mode='t' }, nvim('get_mode'))
command('stopinsert')
- eq({ blocking=false, mode='n' }, nvim('get_mode'))
+ eq({ blocking=false, mode='nt' }, nvim('get_mode'))
end)
it(':stopinsert in normal mode doesn\'t break insert mode #9889', function()
command(':terminal')
- eq({ blocking=false, mode='n' }, nvim('get_mode'))
+ eq({ blocking=false, mode='nt' }, nvim('get_mode'))
command(':stopinsert')
- eq({ blocking=false, mode='n' }, nvim('get_mode'))
+ eq({ blocking=false, mode='nt' }, nvim('get_mode'))
feed('a')
eq({ blocking=false, mode='t' }, nvim('get_mode'))
end)
diff --git a/test/functional/terminal/mouse_spec.lua b/test/functional/terminal/mouse_spec.lua
index 0eb5901b3b..3d8441b93c 100644
--- a/test/functional/terminal/mouse_spec.lua
+++ b/test/functional/terminal/mouse_spec.lua
@@ -33,16 +33,16 @@ describe(':terminal mouse', function()
describe('when the terminal has focus', function()
it('will exit focus on mouse-scroll', function()
- eq('t', eval('mode()'))
+ eq('t', eval('mode(1)'))
feed('<ScrollWheelUp><0,0>')
- eq('n', eval('mode()'))
+ eq('nt', eval('mode(1)'))
end)
it('will exit focus on <C-\\> + mouse-scroll', function()
- eq('t', eval('mode()'))
+ eq('t', eval('mode(1)'))
feed('<C-\\>')
feed('<ScrollWheelUp><0,0>')
- eq('n', eval('mode()'))
+ eq('nt', eval('mode(1)'))
end)
describe('with mouse events enabled by the program', function()
@@ -94,7 +94,7 @@ describe(':terminal mouse', function()
-- When the display area such as a number is clicked, it returns to the
-- normal mode.
feed('<LeftMouse><3,0>')
- eq('n', eval('mode()'))
+ eq('nt', eval('mode(1)'))
screen:expect([[
{7: 11 }^line28 |
{7: 12 }line29 |
diff --git a/test/functional/terminal/window_split_tab_spec.lua b/test/functional/terminal/window_split_tab_spec.lua
index 188afa1e84..c92107082e 100644
--- a/test/functional/terminal/window_split_tab_spec.lua
+++ b/test/functional/terminal/window_split_tab_spec.lua
@@ -111,7 +111,7 @@ describe(':terminal', function()
command('terminal')
feed('a<Cmd>wincmd j<CR>')
eq(2, eval("winnr()"))
- eq('t', eval('mode()'))
+ eq('t', eval('mode(1)'))
end)
end)