diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-10-12 13:29:51 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-10-13 22:10:42 +0200 |
commit | a330129a280a34963e42d498f7cb1f53e6723e85 (patch) | |
tree | f296ab9e478df5641db4a5f09be669300dfae493 /test/functional/ui/screen.lua | |
parent | 5a85699425661a1b508627843c40812d1d07fb2c (diff) | |
download | rneovim-a330129a280a34963e42d498f7cb1f53e6723e85.tar.gz rneovim-a330129a280a34963e42d498f7cb1f53e6723e85.tar.bz2 rneovim-a330129a280a34963e42d498f7cb1f53e6723e85.zip |
tests/ui: cleanup illegitimate usages of "attr_ignore"
"attr_ignore" is an anti-pattern, with snapshot_util()
just include all the highlights already.
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r-- | test/functional/ui/screen.lua | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 68c3d54922..b15e2980de 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -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) |