aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/decorations_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-05-26 11:48:05 +0200
committerGitHub <noreply@github.com>2023-05-26 11:48:05 +0200
commit68da87d2e78432151a237cf0dc47b32846c24f3c (patch)
tree560de49a13b447547a0738b721eb8d06acadb48a /test/functional/ui/decorations_spec.lua
parenta92d78d201e53a4b2fb7b2f811a3f316678a8e6a (diff)
parent455bca1ba86a2524251fea6f79ef668c1e38f6aa (diff)
downloadrneovim-68da87d2e78432151a237cf0dc47b32846c24f3c.tar.gz
rneovim-68da87d2e78432151a237cf0dc47b32846c24f3c.tar.bz2
rneovim-68da87d2e78432151a237cf0dc47b32846c24f3c.zip
Merge pull request #23742 from bfredl/neolight
fix(drawline): combine extmark highlight with area hl correctly
Diffstat (limited to 'test/functional/ui/decorations_spec.lua')
-rw-r--r--test/functional/ui/decorations_spec.lua49
1 files changed, 48 insertions, 1 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua
index 767ec54a7b..3ed31033fa 100644
--- a/test/functional/ui/decorations_spec.lua
+++ b/test/functional/ui/decorations_spec.lua
@@ -660,6 +660,8 @@ describe('extmark decorations', function()
[25] = {background = Screen.colors.LightRed};
[26] = {background=Screen.colors.DarkGrey, foreground=Screen.colors.LightGrey};
[27] = {background = Screen.colors.Plum1};
+ [28] = {underline = true, foreground = Screen.colors.SlateBlue};
+ [29] = {foreground = Screen.colors.SlateBlue, background = Screen.colors.LightGray, underline = true};
}
ns = meths.create_namespace 'test'
@@ -1254,8 +1256,53 @@ describe('extmark decorations', function()
meths.buf_set_extmark(0, ns, 0, 3, { end_col = 6, hl_group = 'TestBold', priority = 20 })
screen:expect_unchanged(true)
end)
-end)
+ it('highlights the beginning of a TAB char correctly', function()
+ screen:try_resize(50, 3)
+ meths.buf_set_lines(0, 0, -1, true, {'this is the\ttab'})
+ meths.buf_set_extmark(0, ns, 0, 11, { end_col = 15, hl_group = 'ErrorMsg' })
+ screen:expect{grid=[[
+ ^this is the{4: tab} |
+ {1:~ }|
+ |
+ ]]}
+
+ meths.buf_clear_namespace(0, ns, 0, -1)
+ meths.buf_set_extmark(0, ns, 0, 12, { end_col = 15, hl_group = 'ErrorMsg' })
+ screen:expect{grid=[[
+ ^this is the {4:tab} |
+ {1:~ }|
+ |
+ ]]}
+ end)
+
+ pending('highlight applies to a full Tab in visual block mode #23734', function()
+ screen:try_resize(50, 8)
+ meths.buf_set_lines(0, 0, -1, true, {'asdf', '\tasdf', '\tasdf', '\tasdf', 'asdf'})
+ meths.buf_set_extmark(0, ns, 0, 0, {end_row = 5, end_col = 0, hl_group = 'Underlined'})
+ screen:expect([[
+ {28:^asdf} |
+ {28: asdf} |
+ {28: asdf} |
+ {28: asdf} |
+ {28:asdf} |
+ {1:~ }|
+ {1:~ }|
+ |
+ ]])
+ feed('<C-V>Gll')
+ screen:expect([[
+ {29:asd}{28:f} |
+ {29: }{28: asdf} |
+ {29: }{28: asdf} |
+ {29: }{28: asdf} |
+ {29:as}{28:^df} |
+ {1:~ }|
+ {1:~ }|
+ {24:-- VISUAL BLOCK --} |
+ ]])
+ end)
+end)
describe('decorations: inline virtual text', function()
local screen, ns