diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-03-22 11:02:52 +0100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2024-03-23 13:44:35 +0100 |
commit | 0c59771e314d6faaad69676985cd2a11c157ee37 (patch) | |
tree | b83d69de5f7a5877e26a4be8b882857a9477a437 /test/functional/ui | |
parent | dc110cba3c0d48d7c9dbb91900f8be0cf6cf0c9b (diff) | |
download | rneovim-0c59771e314d6faaad69676985cd2a11c157ee37.tar.gz rneovim-0c59771e314d6faaad69676985cd2a11c157ee37.tar.bz2 rneovim-0c59771e314d6faaad69676985cd2a11c157ee37.zip |
refactor(tests): all screen tests should use highlights
This is the first installment of a multi-PR series significantly
refactoring how highlights are being specified.
The end goal is to have a base set of 20 ish most common highlights,
and then specific files only need to add more groups to that as needed.
As a complicating factor, we also want to migrate to the new default
color scheme eventually. But by sharing a base set, that future PR
will hopefully be a lot smaller since a lot of tests will be migrated
just simply by updating the base set in place.
As a first step, fix the anti-pattern than Screen defaults to ignoring
highlights. Highlights are integral part of the screen state, not
something "extra" which we only test "sometimes". For now, we still
allow opt-out via the intentionally ugly
screen._default_attr_ids = nil
The end goal is to get rid of all of these eventually (which will be
easier as part of the color scheme migration)
Diffstat (limited to 'test/functional/ui')
-rw-r--r-- | test/functional/ui/cursor_spec.lua | 4 | ||||
-rw-r--r-- | test/functional/ui/messages_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/ui/output_spec.lua | 12 | ||||
-rw-r--r-- | test/functional/ui/screen.lua | 46 | ||||
-rw-r--r-- | test/functional/ui/statuscolumn_spec.lua | 268 | ||||
-rw-r--r-- | test/functional/ui/statusline_spec.lua | 42 | ||||
-rw-r--r-- | test/functional/ui/tabline_spec.lua | 8 | ||||
-rw-r--r-- | test/functional/ui/wildmode_spec.lua | 110 |
8 files changed, 266 insertions, 225 deletions
diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua index 871e9a0790..cf6e342dcf 100644 --- a/test/functional/ui/cursor_spec.lua +++ b/test/functional/ui/cursor_spec.lua @@ -204,7 +204,7 @@ describe('ui/cursor', function() screen:expect { grid = [[ ^ | - ~ |*3 + {1:~ }|*3 test | ]], condition = function() @@ -290,7 +290,7 @@ describe('ui/cursor', function() screen:expect { grid = [[ ^ | - ~ |*3 + {1:~ }|*3 test | ]], condition = function() diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index 78f61968e5..d8f8c8c50a 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -2680,6 +2680,7 @@ it('pager works in headless mode with UI attached', function() local child_session = helpers.connect(child_server) local child_screen = Screen.new(40, 6) child_screen:attach(nil, child_session) + child_screen._default_attr_ids = nil -- TODO: unskip with new color scheme child_session:notify('nvim_command', [[echo range(100)->join("\n")]]) child_screen:expect([[ diff --git a/test/functional/ui/output_spec.lua b/test/functional/ui/output_spec.lua index 5e340af89c..e2315ca7b4 100644 --- a/test/functional/ui/output_spec.lua +++ b/test/functional/ui/output_spec.lua @@ -256,28 +256,28 @@ describe('shell command :!', function() :!'Write-Output $a' | Write-Output $a | | - Press ENTER or type command to continue^ | + {6:Press ENTER or type command to continue}^ | ]]) feed_command([[!$a = 1; Write-Output '$a']]) screen:expect([[ :!$a = 1; Write-Output '$a' | $a | | - Press ENTER or type command to continue^ | + {6:Press ENTER or type command to continue}^ | ]]) feed_command([[!"Write-Output $a"]]) screen:expect([[ :!"Write-Output $a" | Write-Output | | - Press ENTER or type command to continue^ | + {6:Press ENTER or type command to continue}^ | ]]) feed_command([[!$a = 1; Write-Output "$a"]]) screen:expect([[ :!$a = 1; Write-Output "$a" | 1 | | - Press ENTER or type command to continue^ | + {6:Press ENTER or type command to continue}^ | ]]) if is_os('win') then feed_command([[!& 'cmd.exe' /c 'echo $a']]) @@ -285,7 +285,7 @@ describe('shell command :!', function() :!& 'cmd.exe' /c 'echo $a' | $a | | - Press ENTER or type command to continue^ | + {6:Press ENTER or type command to continue}^ | ]]) else feed_command([[!& '/bin/sh' -c 'echo ''$a''']]) @@ -293,7 +293,7 @@ describe('shell command :!', function() :!& '/bin/sh' -c 'echo ''$a''' | $a | | - Press ENTER or type command to continue^ | + {6:Press ENTER or type command to continue}^ | ]]) end end) diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index e8d7d5c72d..cfc6c14f5a 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -139,6 +139,43 @@ local function _init_colors() end Screen.colors = colors Screen.colornames = colornames + + Screen._global_default_attr_ids = { + [1] = { foreground = Screen.colors.Blue1, bold = true }, + [2] = { reverse = true }, + [3] = { bold = true, reverse = true }, + [4] = { background = Screen.colors.LightMagenta }, + [5] = { bold = true }, + [6] = { foreground = Screen.colors.SeaGreen, bold = true }, + [7] = { background = Screen.colors.Gray, foreground = Screen.colors.DarkBlue }, + [8] = { foreground = Screen.colors.Brown }, + [9] = { background = Screen.colors.Red, foreground = Screen.colors.Grey100 }, + [10] = { background = Screen.colors.Yellow }, + [11] = { + foreground = Screen.colors.Blue1, + background = Screen.colors.LightMagenta, + bold = true, + }, + [12] = { background = Screen.colors.Gray }, + [13] = { background = Screen.colors.LightGrey, foreground = Screen.colors.DarkBlue }, + [14] = { background = Screen.colors.DarkGray, foreground = Screen.colors.LightGrey }, + [15] = { foreground = Screen.colors.Brown, bold = true }, + [16] = { foreground = Screen.colors.SlateBlue }, + [17] = { background = Screen.colors.LightGrey, foreground = Screen.colors.Black }, + [18] = { foreground = Screen.colors.Blue1 }, + [19] = { foreground = Screen.colors.Red }, + [20] = { background = Screen.colors.Yellow, foreground = Screen.colors.Red }, + [21] = { background = Screen.colors.Grey90 }, + [22] = { background = Screen.colors.LightBlue }, + [23] = { foreground = Screen.colors.Blue1, background = Screen.colors.LightCyan, bold = true }, + [24] = { background = Screen.colors.LightGrey, underline = true }, + [25] = { foreground = Screen.colors.Cyan4 }, + [26] = { foreground = Screen.colors.Fuchsia }, + [27] = { background = Screen.colors.Red, bold = true }, + [28] = { foreground = Screen.colors.SlateBlue, underline = true }, + [29] = { foreground = Screen.colors.SlateBlue, bold = true }, + [30] = { background = Screen.colors.Red }, + } end --- @param width? integer @@ -257,6 +294,10 @@ function Screen:attach(options, session) if self._options.ext_multigrid then self._options.ext_linegrid = true end + + if self._default_attr_ids == nil then + self._default_attr_ids = Screen._global_default_attr_ids + end end function Screen:detach() @@ -480,7 +521,10 @@ function Screen:expect(expected, attr_ids, ...) attr_state.id_to_index = self:linegrid_check_attrs(attr_state.ids or {}) end - local actual_rows = self:render(not expected.any, attr_state) + local actual_rows + if expected.any or grid then + actual_rows = self:render(not expected.any, attr_state) + end if expected.any then -- Search for `any` anywhere in the screen lines. diff --git a/test/functional/ui/statuscolumn_spec.lua b/test/functional/ui/statuscolumn_spec.lua index 41406a5860..73bedbd10a 100644 --- a/test/functional/ui/statuscolumn_spec.lua +++ b/test/functional/ui/statuscolumn_spec.lua @@ -27,38 +27,38 @@ describe('statuscolumn', function() [[set stc=%{v:relnum?v:relnum:(v:lnum==5?'truncate':v:lnum)}%{!v:relnum&&v:lnum==5?invalid:''}\ ]] ) screen:expect([[ - 4 aaaaa | - 3 aaaaa | - 2 aaaaa | - 1 aaaaa | - 8 ^aaaaa | - 1 aaaaa | - 2 aaaaa | - 3 aaaaa | - 4 aaaaa | - 5 aaaaa | - 6 aaaaa | - 7 aaaaa | - 8 aaaaa | + {8:4 }aaaaa | + {8:3 }aaaaa | + {8:2 }aaaaa | + {8:1 }aaaaa | + {8:8 }^aaaaa | + {8:1 }aaaaa | + {8:2 }aaaaa | + {8:3 }aaaaa | + {8:4 }aaaaa | + {8:5 }aaaaa | + {8:6 }aaaaa | + {8:7 }aaaaa | + {8:8 }aaaaa | | ]]) command('norm 5G') eq('Vim(redraw):E121: Undefined variable: invalid', pcall_err(command, 'redraw!')) eq('', eval('&statuscolumn')) screen:expect([[ - 4 aaaaa | - 5 ^aaaaa | - 6 aaaaa | - 7 aaaaa | - 8 aaaaa | - 9 aaaaa | - 10 aaaaa | - 11 aaaaa | - 12 aaaaa | - 13 aaaaa | - 14 aaaaa | - 15 aaaaa | - 16 aaaaa | + {8: 4 }aaaaa | + {8: 5 }^aaaaa | + {8: 6 }aaaaa | + {8: 7 }aaaaa | + {8: 8 }aaaaa | + {8: 9 }aaaaa | + {8:10 }aaaaa | + {8:11 }aaaaa | + {8:12 }aaaaa | + {8:13 }aaaaa | + {8:14 }aaaaa | + {8:15 }aaaaa | + {8:16 }aaaaa | | ]]) end) @@ -72,9 +72,9 @@ describe('statuscolumn', function() norm 5G | redraw! ]=]) screen:expect([[ - 1 aaaaa virt_text | - bbbbba^eaaa | - 1 aaaaa | + {8:1 }aaaaa virt_text | + {8:bbbbb}a^eaaa | + {8:1 }aaaaa | | ]]) -- Doesn't crash when trying to fill click defs that do not fit (#26845) @@ -84,9 +84,9 @@ describe('statuscolumn', function() norm 5Gzt | redraw! ]=]) screen:expect([[ - bbbbba^eaaa | - 1 aaaaa | - 2 aaaaa | + {8:bbbbb}a^eaaa | + {8:1 }aaaaa | + {8:2 }aaaaa | | ]]) end) @@ -94,19 +94,19 @@ describe('statuscolumn', function() it("works with 'number' and 'relativenumber'", function() command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]]) screen:expect([[ - 4 │aaaaa | - 5 │aaaaa | - 6 │aaaaa | - 7 │aaaaa | - 8 │^aaaaa | - 9 │aaaaa | - 10│aaaaa | - 11│aaaaa | - 12│aaaaa | - 13│aaaaa | - 14│aaaaa | - 15│aaaaa | - 16│aaaaa | + {8:4 │}aaaaa | + {8:5 │}aaaaa | + {8:6 │}aaaaa | + {8:7 │}aaaaa | + {8:8 │}^aaaaa | + {8:9 │}aaaaa | + {8:10│}aaaaa | + {8:11│}aaaaa | + {8:12│}aaaaa | + {8:13│}aaaaa | + {8:14│}aaaaa | + {8:15│}aaaaa | + {8:16│}aaaaa | | ]]) command([[set stc=%l%=%{&rnu?'\ ':''}%r│]]) @@ -114,39 +114,19 @@ describe('statuscolumn', function() command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]]) command('set relativenumber') screen:expect([[ - 4 4│aaaaa | - 5 3│aaaaa | - 6 2│aaaaa | - 7 1│aaaaa | - 8 0│^aaaaa | - 9 1│aaaaa | - 10 2│aaaaa | - 11 3│aaaaa | - 12 4│aaaaa | - 13 5│aaaaa | - 14 6│aaaaa | - 15 7│aaaaa | - 16 8│aaaaa | - | - ]]) - command([[set stc=%l%=%{&rnu?'\ ':''}%r│]]) - screen:expect_unchanged() - command([[set stc=%{&nu?v:lnum:''}%=%{&rnu?'\ '.v:relnum:''}│]]) - command('norm 12GH') - screen:expect([[ - 4 0│^aaaaa | - 5 1│aaaaa | - 6 2│aaaaa | - 7 3│aaaaa | - 8 4│aaaaa | - 9 5│aaaaa | - 10 6│aaaaa | - 11 7│aaaaa | - 12 8│aaaaa | - 13 9│aaaaa | - 14 10│aaaaa | - 15 11│aaaaa | - 16 12│aaaaa | + {8:4 4│}aaaaa | + {8:5 3│}aaaaa | + {8:6 2│}aaaaa | + {8:7 1│}aaaaa | + {8:8 0│}^aaaaa | + {8:9 1│}aaaaa | + {8:10 2│}aaaaa | + {8:11 3│}aaaaa | + {8:12 4│}aaaaa | + {8:13 5│}aaaaa | + {8:14 6│}aaaaa | + {8:15 7│}aaaaa | + {8:16 8│}aaaaa | | ]]) command([[set stc=%l%=%{&rnu?'\ ':''}%r│]]) @@ -735,19 +715,19 @@ describe('statuscolumn', function() virt_lines_leftcol = true, virt_lines = {{{"virt", ""}}} }) ]]) screen:expect([[ - 4 aaaaa | - 5 aaaaa | - 6 aaaaa | - 7 aaaaa | + {7: }{8: 4 }aaaaa | + {7: }{8: 5 }aaaaa | + {7: }{8: 6 }aaaaa | + {7: }{8: 7 }aaaaa | virt | - --------- 8 ^aaaaa | + {7:---------}{8: 8 }^aaaaa | virt | - 𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀 9 aaaaa | - 10 aaaaa | - 11 aaaaa | - 12 aaaaa | - 13 aaaaa | - 14 aaaaa | + {7:𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀𒀀}{8: 9 }aaaaa | + {7: }{8:10 }aaaaa | + {7: }{8:11 }aaaaa | + {7: }{8:12 }aaaaa | + {7: }{8:13 }aaaaa | + {7: }{8:14 }aaaaa | | ]]) command('set stc=') -- also for the default fold column @@ -756,18 +736,18 @@ describe('statuscolumn', function() command([[set stc=%{foldlevel(v:lnum)>0?repeat('-',foldlevel(v:lnum)):''}%=%l\ ]]) feed('Gd10Ggg<C-l>') screen:expect([[ - 1 ^aaaaa | - 2 aaaaa | - 3 aaaaa | - 4 aaaaa | - 5 aaaaa | - 6 aaaaa | - 7 aaaaa | + {8: 1 }^aaaaa | + {8: 2 }aaaaa | + {8: 3 }aaaaa | + {8: 4 }aaaaa | + {8: 5 }aaaaa | + {8: 6 }aaaaa | + {8: 7 }aaaaa | virt | - ---------8 aaaaa | + {8:---------8 }aaaaa | virt | - ---------9 aaaaa | - ~ |*2 + {8:---------9 }aaaaa | + {1:~ }|*2 | ]]) end) @@ -775,15 +755,15 @@ describe('statuscolumn', function() it('works with cmdwin', function() feed(':set stc=%l<CR>q:k$') screen:expect([[ - 7 aaaaa | - 8 aaaaa | - 9 aaaaa | - 10aaaaa | - [No Name] [+] | - :1set stc=%^l | - :2 | - ~ |*5 - [Command Line] | + {8:7 }aaaaa | + {8:8 }aaaaa | + {8:9 }aaaaa | + {8:10}aaaaa | + {2:[No Name] [+] }| + {1::}{8:1}set stc=%^l | + {1::}{8:2} | + {1:~ }|*5 + {3:[Command Line] }| : | ]]) end) @@ -794,11 +774,11 @@ describe('statuscolumn', function() command('set relativenumber') command([[set stc=%{!&nu&&!&rnu?'':&rnu?v:relnum?v:relnum:&nu?v:lnum:'0':v:lnum}]]) screen:expect([[ - 1 aaaaa | - 8 ^aaaaa | - 1 aaaaa | - 2 aaaaa | - 3 aaaaa | + {8:1 }aaaaa | + {8:8 }^aaaaa | + {8:1 }aaaaa | + {8:2 }aaaaa | + {8:3 }aaaaa | | ]]) -- width correctly estimated with "w_nrwidth_line_count" when setting 'stc' @@ -815,11 +795,11 @@ describe('statuscolumn', function() -- width correctly estimated with "w_nrwidth_line_count" when setting 'nu' command('set number') screen:expect([[ - 7 aaaaa | - 8 ^aaaaa | - 9 aaaaa | - 10 aaaaa | - 11 aaaaa | + {8:7 }aaaaa | + {8:8 }^aaaaa | + {8:9 }aaaaa | + {8:10 }aaaaa | + {8:11 }aaaaa | | ]]) end) @@ -846,59 +826,59 @@ describe('statuscolumn', function() ]]) command('sign place 1 line=2 name=sign') screen:expect([[ - 1 ^aaaaa | - 2 ssaaaaa | + {8:1 }^aaaaa | + {8:2 ss}aaaaa | | ]]) command('sign place 2 line=2 name=sign') screen:expect([[ - 1 ^aaaaa | - 2 ssssaaaaa | + {8:1 }^aaaaa | + {8:2 ssss}aaaaa | | ]]) command('sign unplace 2') screen:expect([[ - 1 ^aaaaa | - 2 ssaaaaa | + {8:1 }^aaaaa | + {8:2 ss}aaaaa | | ]]) command('sign unplace 1') screen:expect([[ - 1 ^aaaaa | - 2 aaaaa | + {8:1 }^aaaaa | + {8:2 }aaaaa | | ]]) -- Also for extmark signs exec_lua('id1 = vim.api.nvim_buf_set_extmark(0, ns, 1, 0, {sign_text = "ss"})') screen:expect([[ - 1 ^aaaaa | - 2 ssaaaaa | + {8:1 }^aaaaa | + {8:2 ss}aaaaa | | ]]) exec_lua('id2 = vim.api.nvim_buf_set_extmark(0, ns, 1, 0, {sign_text = "ss"})') screen:expect([[ - 1 ^aaaaa | - 2 ssssaaaaa | + {8:1 }^aaaaa | + {8:2 ssss}aaaaa | | ]]) exec_lua('vim.api.nvim_buf_del_extmark(0, ns, id1)') screen:expect([[ - 1 ^aaaaa | - 2 ssaaaaa | + {8:1 }^aaaaa | + {8:2 ss}aaaaa | | ]]) exec_lua('vim.api.nvim_buf_del_extmark(0, ns, id2)') screen:expect([[ - 1 ^aaaaa | - 2 aaaaa | + {8:1 }^aaaaa | + {8:2 }aaaaa | | ]]) -- In all windows command('wincmd v | set ls=0') command('sign place 1 line=2 name=sign') screen:expect([[ - 1 ^aaaaa │1 aaaaa | - 2 ssaaaaa │2 ssaaaaa | + {8:1 }^aaaaa │{8:1 }aaaaa | + {8:2 ss}aaaaa │{8:2 ss}aaaaa | | ]]) end) @@ -918,12 +898,16 @@ describe('statuscolumn', function() it('does not wrap multibyte characters at the end of a line', function() screen:try_resize(33, 4) + screen:set_default_attr_ids { + [8] = { foreground = Screen.colors.Brown }, + [31] = { undercurl = true, special = Screen.colors.Red }, + } command([[set spell stc=%l\ ]]) command('call setline(8, "This is a line that contains ᶏ multibyte character.")') screen:expect([[ - 8 ^This is a line that contains ᶏ| - multibyte character. | - 9 aaaaa | + {8:8 }^This is a line that contains {31:ᶏ}| + {8: } {31:multibyte} character. | + {8:9 }{31:aaaaa} | | ]]) end) @@ -934,9 +918,9 @@ describe('statuscolumn', function() command('call setline(1, range(1, 99))') feed('Gyyp') screen:expect([[ - 98 98 | - 99 99 | - 100 ^99 | + {8:98 }98 | + {8:99 }99 | + {8:100 }^99 | | ]]) end) diff --git a/test/functional/ui/statusline_spec.lua b/test/functional/ui/statusline_spec.lua index 000e2b1b04..598dcab8d3 100644 --- a/test/functional/ui/statusline_spec.lua +++ b/test/functional/ui/statusline_spec.lua @@ -596,57 +596,59 @@ it('statusline is redrawn on various state changes', function() command('set ls=2 stl=%{repeat(reg_recording(),5)}') screen:expect([[ ^ | - ~ | - |*2 + {1:~ }| + {3: }| + | ]]) feed('qQ') screen:expect([[ ^ | - ~ | - QQQQQ | - recording @Q | + {1:~ }| + {3:QQQQQ }| + {5:recording @Q} | ]]) feed('q') screen:expect([[ ^ | - ~ | - |*2 + {1:~ }| + {3: }| + | ]]) -- Visual mode change #23932 command('set ls=2 stl=%{mode(1)}') screen:expect([[ ^ | - ~ | - n | + {1:~ }| + {3:n }| | ]]) feed('v') screen:expect([[ ^ | - ~ | - v | - -- VISUAL -- | + {1:~ }| + {3:v }| + {5:-- VISUAL --} | ]]) feed('V') screen:expect([[ ^ | - ~ | - V | - -- VISUAL LINE -- | + {1:~ }| + {3:V }| + {5:-- VISUAL LINE --} | ]]) feed('<C-V>') screen:expect([[ ^ | - ~ | - ^V | - -- VISUAL BLOCK -- | + {1:~ }| + {3:^V }| + {5:-- VISUAL BLOCK --} | ]]) feed('<Esc>') screen:expect([[ ^ | - ~ | - n | + {1:~ }| + {3:n }| | ]]) end) diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua index 1c90b17e57..8754a7ef9d 100644 --- a/test/functional/ui/tabline_spec.lua +++ b/test/functional/ui/tabline_spec.lua @@ -31,7 +31,7 @@ describe('ui/ext_tabline', function() screen:expect { grid = [[ ^ | - ~ |*3 + {1:~ }|*3 | ]], condition = function() @@ -44,7 +44,7 @@ describe('ui/ext_tabline', function() screen:expect { grid = [[ ^ | - ~ |*3 + {1:~ }|*3 | ]], condition = function() @@ -62,7 +62,7 @@ describe('ui/ext_tabline', function() screen:expect { grid = [[ ^ | - ~ |*3 + {1:~ }|*3 | ]], condition = function() @@ -81,7 +81,7 @@ describe('ui/ext_tabline', function() screen:expect { grid = [[ ^ | - ~ |*3 + {1:~ }|*3 | ]], condition = function() diff --git a/test/functional/ui/wildmode_spec.lua b/test/functional/ui/wildmode_spec.lua index 667dd64d62..5b83a1c6aa 100644 --- a/test/functional/ui/wildmode_spec.lua +++ b/test/functional/ui/wildmode_spec.lua @@ -14,6 +14,13 @@ describe("'wildmenu'", function() before_each(function() clear() screen = Screen.new(25, 5) + screen:set_default_attr_ids { + [1] = { foreground = Screen.colors.Blue, bold = true }, + [2] = { reverse = true }, + [3] = { bold = true, reverse = true }, + [5] = { bold = true }, + [31] = { foreground = Screen.colors.Grey0, background = Screen.colors.Yellow }, + } screen:attach() end) @@ -105,14 +112,14 @@ describe("'wildmenu'", function() feed(':sign <tab>') screen:expect([[ | - ~ |*2 - define jump list > | + {1:~ }|*2 + {31:define}{3: jump list > }| :sign define^ | ]]) feed('<C-E>') screen:expect([[ | - ~ |*3 + {1:~ }|*3 :sign ^ | ]]) end) @@ -121,14 +128,14 @@ describe("'wildmenu'", function() feed(':sign <tab>') screen:expect([[ | - ~ |*2 - define jump list > | + {1:~ }|*2 + {31:define}{3: jump list > }| :sign define^ | ]]) feed('<tab><C-Y>') screen:expect([[ | - ~ |*3 + {1:~ }|*3 :sign jump^ | ]]) end) @@ -138,8 +145,8 @@ describe("'wildmenu'", function() feed(':sign <tab>') screen:expect([[ | - ~ |*2 - define jump list > | + {1:~ }|*2 + {31:define}{3: jump list > }| :sign define^ | ]]) end) @@ -152,15 +159,15 @@ describe("'wildmenu'", function() feed(':sign <tab>') screen:expect([[ | - ~ |*2 - define jump list > | + {1:~ }|*2 + {31:define}{3: jump list > }| :sign define^ | ]]) feed('<space>') screen:expect([[ | - ~ |*2 - [No Name] | + {1:~ }|*2 + {3:[No Name] }| :sign define ^ | ]]) end) @@ -170,16 +177,16 @@ describe("'wildmenu'", function() feed(':j<Tab><Tab><Tab>') screen:expect([[ | - ~ |*2 - join jumps | + {1:~ }|*2 + {3:join jumps }| :j^ | ]]) -- This would cause nvim to crash before #6650 feed('<BS><Tab>') screen:expect([[ | - ~ |*2 - ! # & < = > @ > | + {1:~ }|*2 + {31:!}{3: # & < = > @ > }| :!^ | ]]) end) @@ -192,7 +199,7 @@ describe("'wildmenu'", function() feed([[:sign <Tab>]]) -- Invoke wildmenu. -- NB: in earlier versions terminal output was redrawn during cmdline mode. -- For now just assert that the screen remains unchanged. - screen:expect { any = 'define jump list > |\n:sign define^ |' } + screen:expect { any = '{31:define}{3: jump list > }|\n:sign define^ |' } screen:expect_unchanged() -- cmdline CTRL-D display should also be preserved. @@ -222,8 +229,8 @@ describe("'wildmenu'", function() screen:expect { grid = [[ | - ~ |*2 - define jump list > | + {1:~ }|*2 + {31:define}{3: jump list > }| :sign define^ | ]], } @@ -252,7 +259,7 @@ describe("'wildmenu'", function() feed([[:<Tab>]]) -- Invoke wildmenu. -- Check only the last 2 lines, because the shell output is -- system-dependent. - screen:expect { any = '! # & < = > @ > |\n:!^' } + screen:expect { any = '{31:!}{3: # & < = > @ > }|\n:!^' } -- Because this test verifies a _lack_ of activity, we must wait the full timeout. -- So make it reasonable. screen:expect_unchanged(false, 1000) @@ -266,27 +273,29 @@ describe("'wildmenu'", function() command('set showtabline=2') feed(':set wildm<tab>') screen:expect([[ - [No Name] | - | - ~ | + {5: [No Name] }{2: }| | + {1:~ }| + {3: }| :set wildm | wildmenu wildmode | :set wildm^ | ]]) feed('<tab>') -- trigger wildmode full screen:expect([[ - [No Name] | - |*2 + {5: [No Name] }{2: }| + | + {3: }| :set wildm | - wildmenu wildmode |*2 + wildmenu wildmode | + {31:wildmenu}{3: wildmode }| :set wildmenu^ | ]]) feed('<Esc>') screen:expect([[ - [No Name] | + {5: [No Name] }{2: }| ^ | - ~ |*4 + {1:~ }|*4 | ]]) end) @@ -301,14 +310,14 @@ describe("'wildmenu'", function() feed(':sign u<tab>') screen:expect([[ | - ~ |*5 + {1:~ }|*5 :sign un^ | ]]) feed('<tab>') -- trigger wildmode list screen:expect([[ | - ~ |*2 - | + {1:~ }|*2 + {3: }| :sign un | undefine unplace | :sign un^ | @@ -316,7 +325,7 @@ describe("'wildmenu'", function() feed('<Esc>') screen:expect([[ ^ | - ~ |*5 + {1:~ }|*5 | ]]) @@ -324,8 +333,8 @@ describe("'wildmenu'", function() feed(':sign un<tab>') screen:expect([[ | - ~ |*2 - | + {1:~ }|*2 + {3: }| :sign un | undefine unplace | :sign un^ | @@ -335,7 +344,7 @@ describe("'wildmenu'", function() feed('<Esc>') screen:expect([[ ^ | - ~ |*5 + {1:~ }|*5 | ]]) end) @@ -348,8 +357,8 @@ describe("'wildmenu'", function() feed(':sign u<tab>') screen:expect([[ | - ~ |*2 - | + {1:~ }|*2 + {3: }| :sign u | undefine unplace | :sign u^ | @@ -357,8 +366,8 @@ describe("'wildmenu'", function() feed('<tab>') -- trigger wildmode longest screen:expect([[ | - ~ |*2 - | + {1:~ }|*2 + {3: }| :sign u | undefine unplace | :sign un^ | @@ -366,7 +375,7 @@ describe("'wildmenu'", function() feed('<Esc>') screen:expect([[ ^ | - ~ |*5 + {1:~ }|*5 | ]]) end) @@ -379,15 +388,16 @@ describe("'wildmenu'", function() feed('<c-d>') screen:expect([[ | - ~ |*2 - | + {1:~ }|*2 + {3: }| :set wildm | wildmenu wildmode | :set wildm^ | ]]) feed('<c-d>') screen:expect([[ - |*2 + | + {3: }| :set wildm | wildmenu wildmode | :set wildm | @@ -397,8 +407,8 @@ describe("'wildmenu'", function() feed('<Esc>') screen:expect([[ ^ | - ~ |*4 - [No Name] | + {1:~ }|*4 + {3:[No Name] }| | ]]) end) @@ -594,7 +604,7 @@ describe('ui/ext_wildmenu', function() screen:expect { grid = [[ | - ~ |*3 + {1:~ }|*3 :sign define^ | ]], wildmenu_items = expected, @@ -605,7 +615,7 @@ describe('ui/ext_wildmenu', function() screen:expect { grid = [[ | - ~ |*3 + {1:~ }|*3 :sign jump^ | ]], wildmenu_items = expected, @@ -616,7 +626,7 @@ describe('ui/ext_wildmenu', function() screen:expect { grid = [[ | - ~ |*3 + {1:~ }|*3 :sign ^ | ]], wildmenu_items = expected, @@ -627,7 +637,7 @@ describe('ui/ext_wildmenu', function() screen:expect { grid = [[ | - ~ |*3 + {1:~ }|*3 :sign define^ | ]], wildmenu_items = expected, @@ -638,7 +648,7 @@ describe('ui/ext_wildmenu', function() screen:expect { grid = [[ | - ~ |*3 + {1:~ }|*3 :sign definea^ | ]], } |