aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/tui_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/terminal/tui_spec.lua')
-rw-r--r--test/functional/terminal/tui_spec.lua53
1 files changed, 53 insertions, 0 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index bf3c6bdb3a..745bfeecf9 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -4,6 +4,7 @@ local global_helpers = require('test.helpers')
local uname = global_helpers.uname
local helpers = require('test.functional.helpers')(after_each)
local thelpers = require('test.functional.terminal.helpers')
+local Screen = require('test.functional.ui.screen')
local eq = helpers.eq
local feed_data = thelpers.feed_data
local feed_command = helpers.feed_command
@@ -179,6 +180,58 @@ describe('tui', function()
{3:-- TERMINAL --} |
]])
end)
+
+ it('allows termguicolors to be set at runtime', function()
+ screen:set_option('rgb', true)
+ screen:set_default_attr_ids({
+ [1] = {reverse = true},
+ [2] = {foreground = 13, special = Screen.colors.Grey0},
+ [3] = {special = Screen.colors.Grey0, bold = true, reverse = true},
+ [4] = {bold = true},
+ [5] = {special = Screen.colors.Grey0, reverse = true, foreground = 4},
+ [6] = {foreground = 4, special = Screen.colors.Grey0},
+ [7] = {special = Screen.colors.Grey0, reverse = true, foreground = Screen.colors.SeaGreen4},
+ [8] = {foreground = Screen.colors.SeaGreen4, special = Screen.colors.Grey0},
+ [9] = {special = Screen.colors.Grey0, bold = true, foreground = Screen.colors.Blue1},
+ })
+
+ feed_data(':hi SpecialKey ctermfg=3 guifg=SeaGreen\n')
+ feed_data('i')
+ feed_data('\022\007') -- ctrl+g
+ feed_data('\028\014') -- crtl+\ ctrl+N
+ feed_data(':set termguicolors?\n')
+ screen:expect([[
+ {5:^}{6:G} |
+ {2:~ }|
+ {2:~ }|
+ {2:~ }|
+ {3:[No Name] [+] }|
+ notermguicolors |
+ {4:-- TERMINAL --} |
+ ]])
+
+ feed_data(':set termguicolors\n')
+ screen:expect([[
+ {7:^}{8:G} |
+ {9:~ }|
+ {9:~ }|
+ {9:~ }|
+ {3:[No Name] [+] }|
+ |
+ {4:-- TERMINAL --} |
+ ]])
+
+ feed_data(':set notermguicolors\n')
+ screen:expect([[
+ {5:^}{6:G} |
+ {2:~ }|
+ {2:~ }|
+ {2:~ }|
+ {3:[No Name] [+] }|
+ |
+ {4:-- TERMINAL --} |
+ ]])
+ end)
end)
describe('tui with non-tty file descriptors', function()