tests/ui: cleanup illegitimate usages of "attr_ignore"

"attr_ignore" is an anti-pattern, with snapshot_util()
just include all the highlights already.
This commit is contained in:
Björn Linse
2019-10-12 13:29:51 +02:00
parent 5a85699425
commit a330129a28
8 changed files with 90 additions and 83 deletions

View File

@@ -66,7 +66,6 @@
-- [1] = {reverse = true, bold = true},
-- [2] = {reverse = true}
-- })
-- screen:set_default_attr_ignore( {{}, {bold=true, foreground=NonText}} )
--
-- To help write screen tests, see Screen:snapshot_util().
-- To debug screen tests, see Screen:redraw_debug().
@@ -169,7 +168,6 @@ function Screen.new(width, height)
ruler = {},
hl_groups = {},
_default_attr_ids = nil,
_default_attr_ignore = nil,
_mouse_enabled = true,
_attrs = {},
_hl_info = {[0]={}},
@@ -202,10 +200,6 @@ function Screen:get_default_attr_ids()
return deepcopy(self._default_attr_ids)
end
function Screen:set_default_attr_ignore(attr_ignore)
self._default_attr_ignore = attr_ignore
end
function Screen:set_rgb_cterm(val)
self._rgb_cterm = val
end
@@ -361,7 +355,7 @@ function Screen:expect(expected, attr_ids, attr_ignore, ...)
end
local attr_state = {
ids = attr_ids or self._default_attr_ids,
ignore = attr_ignore or self._default_attr_ignore,
ignore = attr_ignore
}
if self._options.ext_linegrid then
attr_state.id_to_index = self:linegrid_check_attrs(attr_state.ids or {})
@@ -1478,6 +1472,8 @@ function Screen:_get_attr_id(attr_state, attrs, hl_id)
return nil
elseif id ~= nil then
return id
elseif attr_state.ignore == true then
return nil
end
if attr_state.mutable then
id = self:_insert_hl_id(attr_state, hl_id)