diff options
author | bfredl <bjorn.linse@gmail.com> | 2024-04-03 13:39:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 13:39:08 +0200 |
commit | 1b55ed58ecaba96f91a21685b7019362320ea156 (patch) | |
tree | 34ebd294c4b92819f0305f75e69134a706b67bbc /test/functional/ui/screen.lua | |
parent | dbc0fa9bd6831ea060df410b70de32627c5c1f68 (diff) | |
parent | fa74f7571094dba15a7e8e216beef11786cff203 (diff) | |
download | rneovim-1b55ed58ecaba96f91a21685b7019362320ea156.tar.gz rneovim-1b55ed58ecaba96f91a21685b7019362320ea156.tar.bz2 rneovim-1b55ed58ecaba96f91a21685b7019362320ea156.zip |
Merge pull request #28156 from bfredl/attr_extend
refactor(tests): allow to extend the new base set of attrs
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r-- | test/functional/ui/screen.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index ee9334a9fe..ab535afbf4 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -255,6 +255,17 @@ function Screen:set_default_attr_ids(attr_ids) self._default_attr_ids = attr_ids end +function Screen:add_extra_attr_ids(extra_attr_ids) + local attr_ids = vim.deepcopy(Screen._global_default_attr_ids) + for id, attr in pairs(extra_attr_ids) do + if type(id) == 'number' and id < 100 then + error('extra attr ids should be at least 100 or be strings') + end + attr_ids[id] = attr + end + self._default_attr_ids = attr_ids +end + function Screen:get_default_attr_ids() return deepcopy(self._default_attr_ids) end |