aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/editor/tabpage_spec.lua41
-rw-r--r--test/functional/terminal/buffer_spec.lua39
2 files changed, 80 insertions, 0 deletions
diff --git a/test/functional/editor/tabpage_spec.lua b/test/functional/editor/tabpage_spec.lua
index 3b2c1db350..7dd0b9f154 100644
--- a/test/functional/editor/tabpage_spec.lua
+++ b/test/functional/editor/tabpage_spec.lua
@@ -1,4 +1,5 @@
local helpers = require('test.functional.helpers')(after_each)
+local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local command = helpers.command
@@ -53,6 +54,46 @@ describe('tabpage', function()
neq(999, eval('g:win_closed'))
end)
+ it('switching tabpage after setting laststatus=3 #19591', function()
+ local screen = Screen.new(40, 8)
+ screen:set_default_attr_ids({
+ [0] = {bold = true, foreground = Screen.colors.Blue},
+ [1] = {bold = true, reverse = true}, -- StatusLine
+ [2] = {reverse = true}, -- StatusLineNC, TabLineFill
+ [3] = {bold = true}, -- TabLineSel
+ [4] = {background = Screen.colors.LightGrey, underline = true}, -- TabLine
+ [5] = {bold = true, foreground = Screen.colors.Magenta},
+ })
+ screen:attach()
+
+ command('tabnew')
+ command('tabprev')
+ command('set laststatus=3')
+ command('tabnext')
+ feed('<C-G>')
+ screen:expect([[
+ {4: [No Name] }{3: [No Name] }{2: }{4:X}|
+ ^ |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {1:[No Name] }|
+ "[No Name]" --No lines in buffer-- |
+ ]])
+ command('vnew')
+ screen:expect([[
+ {4: [No Name] }{3: }{5:2}{3: [No Name] }{2: }{4:X}|
+ ^ │ |
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {0:~ }│{0:~ }|
+ {1:[No Name] }|
+ "[No Name]" --No lines in buffer-- |
+ ]])
+ end)
+
it(":tabmove handles modifiers and addr", function()
command('tabnew | tabnew | tabnew')
eq(4, funcs.nvim_tabpage_get_number(0))
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index ec3066c20d..23430a620b 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -13,6 +13,7 @@ local exc_exec = helpers.exc_exec
local matches = helpers.matches
local exec_lua = helpers.exec_lua
local sleep = helpers.sleep
+local funcs = helpers.funcs
describe(':terminal buffer', function()
local screen
@@ -300,6 +301,44 @@ describe(':terminal buffer', function()
feed_command('put a') -- register a is empty
helpers.assert_alive()
end)
+
+ it([[can use temporary normal mode <c-\><c-o>]], function()
+ eq('t', funcs.mode(1))
+ feed [[<c-\><c-o>]]
+ screen:expect{grid=[[
+ tty ready |
+ {2:^ } |
+ |
+ |
+ |
+ |
+ {3:-- (terminal) --} |
+ ]]}
+ eq('ntT', funcs.mode(1))
+
+ feed [[:let g:x = 17]]
+ screen:expect{grid=[[
+ tty ready |
+ {2: } |
+ |
+ |
+ |
+ |
+ :let g:x = 17^ |
+ ]]}
+
+ feed [[<cr>]]
+ screen:expect{grid=[[
+ tty ready |
+ {1: } |
+ |
+ |
+ |
+ |
+ {3:-- TERMINAL --} |
+ ]]}
+ eq('t', funcs.mode(1))
+ end)
end)
describe('No heap-buffer-overflow when using', function()