aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/tabline_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2024-11-25 19:15:05 +0000
committerJosh Rahm <joshuarahm@gmail.com>2024-11-25 19:27:38 +0000
commitc5d770d311841ea5230426cc4c868e8db27300a8 (patch)
treedd21f70127b4b8b5f109baefc8ecc5016f507c91 /test/functional/ui/tabline_spec.lua
parent9be89f131f87608f224f0ee06d199fcd09d32176 (diff)
parent081beb3659bd6d8efc3e977a160b1e72becbd8a2 (diff)
downloadrneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.gz
rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.bz2
rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.zip
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/ui/tabline_spec.lua')
-rw-r--r--test/functional/ui/tabline_spec.lua63
1 files changed, 60 insertions, 3 deletions
diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua
index 5cda70df21..6d212823eb 100644
--- a/test/functional/ui/tabline_spec.lua
+++ b/test/functional/ui/tabline_spec.lua
@@ -13,8 +13,7 @@ describe('ui/ext_tabline', function()
before_each(function()
clear()
- screen = Screen.new(25, 5)
- screen:attach({ rgb = true, ext_tabline = true })
+ screen = Screen.new(25, 5, { rgb = true, ext_tabline = true })
function screen:_handle_tabline_update(curtab, tabs, curbuf, buffers)
event_curtab = curtab
event_tabs = tabs
@@ -100,7 +99,6 @@ describe('tabline', function()
before_each(function()
clear()
screen = Screen.new(42, 5)
- screen:attach()
end)
it('redraws when tabline option is set', function()
@@ -125,6 +123,26 @@ describe('tabline', function()
}
end)
+ it('combines highlight attributes', function()
+ screen:set_default_attr_ids({
+ [1] = { foreground = Screen.colors.Blue1, bold = true }, -- StatusLine
+ [2] = { bold = true, italic = true }, -- StatusLine
+ [3] = { bold = true, italic = true, foreground = Screen.colors.Red }, -- NonText combined with StatusLine
+ })
+ command('hi TabLineFill gui=bold,italic')
+ command('hi Identifier guifg=red')
+ command('set tabline=Test%#Identifier#here')
+ command('set showtabline=2')
+ screen:expect {
+ grid = [[
+ {2:Test}{3:here }|
+ ^ |
+ {1:~ }|*2
+ |
+ ]],
+ }
+ end)
+
it('click definitions do not leak memory #21765', function()
command('set tabline=%@MyClickFunc@MyClickText%T')
command('set showtabline=2')
@@ -196,4 +214,43 @@ describe('tabline', function()
api.nvim_input_mouse('middle', 'press', '', 0, 0, 1)
eq({ 1, 1 }, api.nvim_eval('[tabpagenr(), tabpagenr("$")]'))
end)
+
+ it('does not show floats with focusable=false', function()
+ screen:set_default_attr_ids({
+ [1] = { background = Screen.colors.Plum1 },
+ [2] = { underline = true, background = Screen.colors.LightGrey },
+ [3] = { bold = true },
+ [4] = { reverse = true },
+ [5] = { bold = true, foreground = Screen.colors.Blue1 },
+ [6] = { foreground = Screen.colors.Fuchsia, bold = true },
+ [7] = { foreground = Screen.colors.SeaGreen, bold = true },
+ })
+ command('tabnew')
+ api.nvim_open_win(0, false, {
+ focusable = false,
+ relative = 'editor',
+ height = 1,
+ width = 1,
+ row = 0,
+ col = 0,
+ })
+ screen:expect {
+ grid = [[
+ {1: }{2:[No Name] }{3: [No Name] }{4: }{2:X}|
+ ^ |
+ {5:~ }|*2
+ |
+ ]],
+ }
+ command('tabs')
+ screen:expect {
+ grid = [[
+ {6:Tab page 1} |
+ # [No Name] |
+ {6:Tab page 2} |
+ > [No Name] |
+ {7:Press ENTER or type command to continue}^ |
+ ]],
+ }
+ end)
end)