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 | |
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')
-rw-r--r-- | test/functional/ui/mouse_spec.lua | 14 | ||||
-rw-r--r-- | test/functional/ui/screen.lua | 10 |
2 files changed, 11 insertions, 13 deletions
diff --git a/test/functional/ui/mouse_spec.lua b/test/functional/ui/mouse_spec.lua index 440bae58e0..fedef7da8a 100644 --- a/test/functional/ui/mouse_spec.lua +++ b/test/functional/ui/mouse_spec.lua @@ -26,6 +26,8 @@ describe('ui/mouse/input', function() }, [4] = {reverse = true}, [5] = {bold = true, reverse = true}, + [6] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red}, + [7] = {bold = true, foreground = Screen.colors.SeaGreen4}, }) command("set display-=msgsep") feed('itesting<cr>mouse<cr>support and selection<esc>') @@ -620,12 +622,12 @@ describe('ui/mouse/input', function() meths.set_option('tags', './non-existent-tags-file') feed('<C-LeftMouse><0,0>') screen:expect([[ - E433: No tags file | - E426: tag not found: test| - ing | - Press ENTER or type comma| - nd to continue^ | - ]],nil,true) + {6:E433: No tags file} | + {6:E426: tag not found: test}| + {6:ing} | + {7:Press ENTER or type comma}| + {7:nd to continue}^ | + ]]) feed('<cr>') end) 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) |