aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/fold_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-25 22:14:12 +0800
committerGitHub <noreply@github.com>2023-05-25 22:14:12 +0800
commitee986ee0449b828ca64bf7d4c69624596aab8319 (patch)
tree0e0f24d7bb3f40aa1173b65d798eab922cea91bd /test/functional/ui/fold_spec.lua
parentaa9d46b6724cf3454aca602e64350856827c3ab8 (diff)
downloadrneovim-ee986ee0449b828ca64bf7d4c69624596aab8319.tar.gz
rneovim-ee986ee0449b828ca64bf7d4c69624596aab8319.tar.bz2
rneovim-ee986ee0449b828ca64bf7d4c69624596aab8319.zip
fix(folds): combined Folded and Visual highlights (#23752)
Also combine high-priority CursorLine with Folded.
Diffstat (limited to 'test/functional/ui/fold_spec.lua')
-rw-r--r--test/functional/ui/fold_spec.lua37
1 files changed, 27 insertions, 10 deletions
diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua
index 2afe27ecc7..520979a2c2 100644
--- a/test/functional/ui/fold_spec.lua
+++ b/test/functional/ui/fold_spec.lua
@@ -42,9 +42,10 @@ describe("folded lines", function()
[9] = {bold = true, foreground = Screen.colors.Brown},
[10] = {background = Screen.colors.LightGrey, underline = true},
[11] = {bold=true},
- [12] = {background = Screen.colors.Grey90, underline = true},
- [13] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey, underline = true},
- [14] = {background = Screen.colors.LightGray},
+ [12] = {foreground = Screen.colors.Red},
+ [13] = {foreground = Screen.colors.Red, background = Screen.colors.LightGrey},
+ [14] = {background = Screen.colors.Red},
+ [15] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.Red},
})
end)
@@ -88,10 +89,9 @@ describe("folded lines", function()
end
end)
- it("foldcolumn highlighted with CursorLineFold when 'cursorline' is set", function()
+ local function test_folded_cursorline()
command("set number cursorline foldcolumn=2")
command("hi link CursorLineFold Search")
- command("hi! CursorLine gui=underline guibg=Grey90")
insert(content1)
feed("ggzf3jj")
if multigrid then
@@ -239,6 +239,22 @@ describe("folded lines", function()
|
]])
end
+ end
+
+ describe("when 'cursorline' is set", function()
+ it('with high-priority CursorLine', function()
+ command("hi! CursorLine guibg=NONE guifg=Red gui=NONE")
+ test_folded_cursorline()
+ end)
+
+ it('with low-priority CursorLine', function()
+ command("hi! CursorLine guibg=NONE guifg=NONE gui=underline")
+ local attrs = screen:get_default_attr_ids()
+ attrs[12] = {underline = true}
+ attrs[13] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey, underline = true}
+ screen:set_default_attr_ids(attrs)
+ test_folded_cursorline()
+ end)
end)
it("work with spell", function()
@@ -2017,7 +2033,8 @@ describe("folded lines", function()
end
end)
- it('Folded highlight does not disappear in Visual selection #19691', function()
+ it('Folded and Visual highlights are combined #19691', function()
+ command('hi! Visual guibg=Red')
insert([[
" foo
" {{{1
@@ -2044,9 +2061,9 @@ describe("folded lines", function()
[3:---------------------------------------------]|
## grid 2
{14:" fo}o |
- {5:+-- 3 lines: "······························}|
+ {15:+-- }{5: 3 lines: "······························}|
{14:" ba}r |
- {5:+-- 3 lines: "······························}|
+ {15:+-- }{5: 3 lines: "······························}|
{14:" b}^az |
{1:~ }|
{1:~ }|
@@ -2056,9 +2073,9 @@ describe("folded lines", function()
else
screen:expect([[
{14:" fo}o |
- {5:+-- 3 lines: "······························}|
+ {15:+-- }{5: 3 lines: "······························}|
{14:" ba}r |
- {5:+-- 3 lines: "······························}|
+ {15:+-- }{5: 3 lines: "······························}|
{14:" b}^az |
{1:~ }|
{1:~ }|