aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-02-12 10:11:30 +0100
committerJustin M. Keyes <justinkz@gmail.com>2019-02-12 10:11:30 +0100
commite50d0b6fc19fe7555651166b73aff9c3703ef11a (patch)
tree84424f03bc722d2ce3b695132dc5a4b8a1d3b02d /test
parentc5173230f065d68fe261443a420fc87bd633c8e8 (diff)
downloadrneovim-e50d0b6fc19fe7555651166b73aff9c3703ef11a.tar.gz
rneovim-e50d0b6fc19fe7555651166b73aff9c3703ef11a.tar.bz2
rneovim-e50d0b6fc19fe7555651166b73aff9c3703ef11a.zip
UI: change implementation of hl_rgb2cterm_color()
Replace the implementation cargo-culted from Vim's source with something simpler which "seems to look better" with 'pumblend'.
Diffstat (limited to 'test')
-rw-r--r--test/functional/ui/popupmenu_spec.lua39
1 files changed, 38 insertions, 1 deletions
diff --git a/test/functional/ui/popupmenu_spec.lua b/test/functional/ui/popupmenu_spec.lua
index 62428c9657..9a8c5a5789 100644
--- a/test/functional/ui/popupmenu_spec.lua
+++ b/test/functional/ui/popupmenu_spec.lua
@@ -1273,7 +1273,7 @@ describe('builtin popupmenu', function()
]])
end)
- it('works with pumblend', function()
+ it("'pumblend' RGB-color", function()
screen:try_resize(60,14)
screen:set_default_attr_ids({
[1] = {background = Screen.colors.Yellow},
@@ -1448,4 +1448,41 @@ describe('builtin popupmenu', function()
{20:-- INSERT --} |
]])
end)
+
+ it("'pumblend' 256-color (non-RGB)", function()
+ screen:detach()
+ screen = Screen.new(60, 8)
+ screen:attach({rgb=false, ext_popupmenu=false})
+ screen:set_default_attr_ids({
+ [1] = {foreground = Screen.colors.Grey0, background = tonumber('0x000007')},
+ [2] = {foreground = tonumber('0x000055'), background = tonumber('0x000007')},
+ [3] = {foreground = tonumber('0x00008f'), background = Screen.colors.Grey0},
+ [4] = {foreground = Screen.colors.Grey0, background = tonumber('0x0000e1')},
+ [5] = {foreground = tonumber('0x0000d1'), background = tonumber('0x0000e1')},
+ [6] = {foreground = Screen.colors.NavyBlue, background = tonumber('0x0000f8')},
+ [7] = {foreground = tonumber('0x0000a5'), background = tonumber('0x0000f8')},
+ [8] = {foreground = tonumber('0x00000c')},
+ [9] = {bold = true},
+ [10] = {foreground = tonumber('0x000002')},
+ })
+ command('set notermguicolors pumblend=10')
+ insert([[
+ Lorem ipsum dolor sit amet, consectetur
+ adipisicing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua.
+ Ut enim ad minim veniam, quis nostrud
+ laborum.]])
+
+ feed('ggOdo<c-x><c-n>')
+ screen:expect([[
+ dolor^ |
+ {1:dolor}{2: ipsum dol}or sit amet, consectetur |
+ {4:do}{5:ipisicing eli}t, sed do eiusmod tempor |
+ {4:dolore}{5:dunt ut l}abore et dolore magna aliqua. |
+ Ut enim ad minim veniam, quis nostrud |
+ laborum. |
+ {8:~ }|
+ {9:-- Keyword Local completion (^N^P) }{10:match 1 of 3} |
+ ]])
+ end)
end)