Skip to content

Commit

Permalink
test(fold): add test for CursorLineFold
Browse files Browse the repository at this point in the history
  • Loading branch information
gpanders authored and jamessan committed Dec 9, 2021
1 parent 931f499 commit ed35e20
Showing 1 changed file with 112 additions and 0 deletions.
112 changes: 112 additions & 0 deletions test/functional/ui/fold_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ 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},
})
end)

Expand Down Expand Up @@ -84,6 +85,117 @@ describe("folded lines", function()
end
end)

it("highlights with CursorLineFold when 'cursorline' is set", function()
command("set cursorline foldcolumn=2 foldmethod=marker")
command("hi link CursorLineFold Search")
insert(content1)
feed("zf3j")
if multigrid then
screen:expect([[
## grid 1
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[3:---------------------------------------------]|
## grid 2
{7: }This is a |
{7: }valid English |
{7: }sentence composed by |
{7: }an exhausted developer |
{7: }in his cave. |
{6: }{12:^ }|
{1:~ }|
## grid 3
|
]])
else
screen:expect([[
{7: }This is a |
{7: }valid English |
{7: }sentence composed by |
{7: }an exhausted developer |
{7: }in his cave. |
{6: }{12:^ }|
{1:~ }|
|
]])
end
feed("k")
if multigrid then
screen:expect([[
## grid 1
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[3:---------------------------------------------]|
## grid 2
{7: }This is a |
{7: }valid English |
{7: }sentence composed by |
{7: }an exhausted developer |
{6: }{12:^in his cave. }|
{7: } |
{1:~ }|
## grid 3
|
]])
else
screen:expect([[
{7: }This is a |
{7: }valid English |
{7: }sentence composed by |
{7: }an exhausted developer |
{6: }{12:^in his cave. }|
{7: } |
{1:~ }|
|
]])
end
command("set cursorlineopt=line")
if multigrid then
screen:expect([[
## grid 1
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[2:---------------------------------------------]|
[3:---------------------------------------------]|
## grid 2
{7: }This is a |
{7: }valid English |
{7: }sentence composed by |
{7: }an exhausted developer |
{7: }{12:^in his cave. }|
{7: } |
{1:~ }|
## grid 3
|
]])
else
screen:expect([[
{7: }This is a |
{7: }valid English |
{7: }sentence composed by |
{7: }an exhausted developer |
{7: }{12:^in his cave. }|
{7: } |
{1:~ }|
|
]])
end
end)

it("highlighting with relative line numbers", function()
command("set relativenumber cursorline cursorlineopt=number foldmethod=marker")
feed_command("set foldcolumn=2")
Expand Down

0 comments on commit ed35e20

Please sign in to comment.