diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2019-11-03 11:07:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-03 11:07:40 +0100 |
commit | 93626b8af9c12425013f02c2ad52f2ac54317fc4 (patch) | |
tree | 4aa82a631dcba2da11f603bf931a462cefec7b83 /test/functional/ui/screen.lua | |
parent | 75ad5587477b1fc90cb0c693794ee7053c3339c7 (diff) | |
parent | f707a7ef6885d791411077079e1a2783d8c1b169 (diff) | |
download | rneovim-93626b8af9c12425013f02c2ad52f2ac54317fc4.tar.gz rneovim-93626b8af9c12425013f02c2ad52f2ac54317fc4.tar.bz2 rneovim-93626b8af9c12425013f02c2ad52f2ac54317fc4.zip |
Merge pull request #10994 from bfredl/colorindex
allow pass through of :terminal palette colors with termguicolors
Diffstat (limited to 'test/functional/ui/screen.lua')
-rw-r--r-- | test/functional/ui/screen.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index b57e13fea1..41e022791e 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -1362,6 +1362,7 @@ function Screen:linegrid_check_attrs(attrs) if self._rgb_cterm then attr_rgb, attr_cterm, info = unpack(v) attr = {attr_rgb, attr_cterm} + info = info or {} elseif self._options.ext_hlstate then attr, info = unpack(v) else @@ -1400,11 +1401,12 @@ end function Screen:_pprint_hlitem(item) -- print(inspect(item)) local multi = self._rgb_cterm or self._options.ext_hlstate - local attrdict = "{"..self:_pprint_attrs(multi and item[1] or item).."}" + local cterm = (not self._rgb_cterm and not self._options.rgb) + local attrdict = "{"..self:_pprint_attrs(multi and item[1] or item, cterm).."}" local attrdict2, hlinfo local descdict = "" if self._rgb_cterm then - attrdict2 = ", {"..self:_pprint_attrs(item[2]).."}" + attrdict2 = ", {"..self:_pprint_attrs(item[2], true).."}" hlinfo = item[3] else attrdict2 = "" @@ -1433,13 +1435,15 @@ function Screen:_pprint_hlinfo(states) end -function Screen:_pprint_attrs(attrs) +function Screen:_pprint_attrs(attrs, cterm) local items = {} for f, v in pairs(attrs) do local desc = tostring(v) if f == "foreground" or f == "background" or f == "special" then if Screen.colornames[v] ~= nil then desc = "Screen.colors."..Screen.colornames[v] + elseif cterm then + desc = tostring(v) else desc = string.format("tonumber('0x%06x')",v) end @@ -1511,7 +1515,8 @@ function Screen:_equal_attrs(a, b) a.italic == b.italic and a.reverse == b.reverse and a.foreground == b.foreground and a.background == b.background and a.special == b.special and a.blend == b.blend and - a.strikethrough == b.strikethrough + a.strikethrough == b.strikethrough and + a.fg_indexed == b.fg_indexed and a.bg_indexed == b.bg_indexed end function Screen:_equal_info(a, b) |