diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-03-23 20:01:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-23 20:01:21 +0100 |
commit | 3d9c028a4ce1557af7f7269968db5dd0c480f270 (patch) | |
tree | fa08e1ee69250026610790531336a9dbef0a4aaf /test/functional/ui/screen.lua | |
parent | 2c1e8f7e96926f70151d737ea32f1e6ff3589263 (diff) | |
parent | 0c59771e314d6faaad69676985cd2a11c157ee37 (diff) | |
download | rneovim-3d9c028a4ce1557af7f7269968db5dd0c480f270.tar.gz rneovim-3d9c028a4ce1557af7f7269968db5dd0c480f270.tar.bz2 rneovim-3d9c028a4ce1557af7f7269968db5dd0c480f270.zip |
Merge pull request #27980 from bfredl/noignore
refactor(tests): all screen tests should use highlights
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r-- | test/functional/ui/screen.lua | 46 |
1 files changed, 45 insertions, 1 deletions
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. |