From e049c6e4c08a141c94218672e770f86f91c27a11 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Sat, 12 Oct 2024 10:57:31 -0700 Subject: feat(ui): statusline text inherits highlights #29976 Changes apply to the winbar, statusline, and tabline text. --- test/functional/ui/winbar_spec.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/functional/ui/winbar_spec.lua') diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua index fb907026a5..bbdf3ad9ba 100644 --- a/test/functional/ui/winbar_spec.lua +++ b/test/functional/ui/winbar_spec.lua @@ -40,6 +40,16 @@ describe('winbar', function() bold = true, foreground = Screen.colors.Magenta, }, + [12] = { + underline = true, + background = Screen.colors.Red, + }, + [13] = { + underline = true, + bold = true, + foreground = Screen.colors.Blue, + background = Screen.colors.Red, + }, }) api.nvim_set_option_value('winbar', 'Set Up The Bars', {}) end) @@ -182,6 +192,18 @@ describe('winbar', function() ]]) end) + it('works with combined highlight attributes', function() + command('hi Winbar guibg=red gui=underline') + command('hi Identifier guifg=blue gui=bold') + command('set winbar=Lookatmy%#Identifier#highlights') + screen:expect([[ + {12:Lookatmy}{13:highlights }| + ^ | + {3:~ }|*10 + | + ]]) + end) + it('can be ruler', function() insert [[ just some -- cgit From e61228a214ebda9845db9462dad0a8c362d3963f Mon Sep 17 00:00:00 2001 From: bfredl Date: Mon, 11 Nov 2024 22:15:19 +0100 Subject: fix(tests): needing two calls to setup a screen is cringe Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session. --- test/functional/ui/winbar_spec.lua | 3 --- 1 file changed, 3 deletions(-) (limited to 'test/functional/ui/winbar_spec.lua') diff --git a/test/functional/ui/winbar_spec.lua b/test/functional/ui/winbar_spec.lua index bbdf3ad9ba..d1fd273dc1 100644 --- a/test/functional/ui/winbar_spec.lua +++ b/test/functional/ui/winbar_spec.lua @@ -18,7 +18,6 @@ describe('winbar', function() before_each(function() clear() screen = Screen.new(60, 13) - screen:attach() screen:set_default_attr_ids({ [1] = { bold = true }, [2] = { reverse = true }, @@ -548,7 +547,6 @@ describe('local winbar with tabs', function() before_each(function() clear() screen = Screen.new(60, 10) - screen:attach() api.nvim_set_option_value('winbar', 'foo', { scope = 'local', win = 0 }) end) @@ -626,7 +624,6 @@ it('winbar works properly when redrawing is postponed #23534', function() }, }) local screen = Screen.new(60, 6) - screen:attach() screen:expect([[ {5:(winbar) }| ^ | -- cgit