aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/highlight_spec.lua
diff options
context:
space:
mode:
authorYichao Zhou <broken.zhou@gmail.com>2017-03-27 18:42:03 -0700
committerJustin M. Keyes <justinkz@gmail.com>2018-06-28 01:49:40 +0200
commit12481781a0215c2ba0ab250d9cfdb9a082ab495a (patch)
tree58cc551eac8fb54092419196699c4378fcd6031c /test/functional/ui/highlight_spec.lua
parent166aaf178cce457381e80f0e5230a0f941f0e17c (diff)
downloadrneovim-12481781a0215c2ba0ab250d9cfdb9a082ab495a.tar.gz
rneovim-12481781a0215c2ba0ab250d9cfdb9a082ab495a.tar.bz2
rneovim-12481781a0215c2ba0ab250d9cfdb9a082ab495a.zip
highlight: high-priority CursorLine if fg is set. #8578
closes #7383 closes #7715 This implements the compromise described in #7383: * low-priority CursorLine if foreground is not set * high-priority ("same as Vim" priority) CursorLine if foreground is set ref d1874ab2821d076397290cc154d87ec2dc352c79 ref 56eda2aa17c80ba380b606f9466f288fb8162dd3
Diffstat (limited to 'test/functional/ui/highlight_spec.lua')
-rw-r--r--test/functional/ui/highlight_spec.lua46
1 files changed, 43 insertions, 3 deletions
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index ab3b1c3cac..b46a6c1e46 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -541,7 +541,7 @@ describe("'listchars' highlight", function()
]])
feed_command('set cursorline')
screen:expect([[
- {2:^>-------.}{1:abcd}{2:.}{1:Lorem}{4:>}|
+ {2:^>-------.}{1:abcd}{2:.}{1:Lorem}{3:>}|
{5:>-------.}abcd{5:*}{4:¬} |
{4:¬} |
{4:~ }|
@@ -549,7 +549,7 @@ describe("'listchars' highlight", function()
]])
feed('$')
screen:expect([[
- {4:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
+ {3:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
{4:<} |
{4:<} |
{4:~ }|
@@ -630,7 +630,7 @@ describe("'listchars' highlight", function()
feed('<esc>$')
screen:expect([[
{4:<} |
- {4:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
+ {3:<}{1:r}{2:.}{1:sit}{2:.}{1:ame^t}{3:¬}{1: }|
{4:<} |
{4:~ }|
|
@@ -675,6 +675,46 @@ describe("'listchars' highlight", function()
end)
end)
+describe('CursorLine highlight', function()
+ before_each(clear)
+ it('overridden by Error, ColorColumn if fg not set', function()
+ local screen = Screen.new(50,5)
+ screen:set_default_attr_ids({
+ [1] = {foreground = Screen.colors.SlateBlue},
+ [2] = {bold = true, foreground = Screen.colors.Brown},
+ [3] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red},
+ [4] = {foreground = Screen.colors.SlateBlue, background = Screen.colors.Gray90},
+ [5] = {background = Screen.colors.Gray90},
+ [6] = {bold = true, foreground = Screen.colors.Blue1},
+ [7] = {background = Screen.colors.LightRed},
+ })
+ screen:attach()
+
+ feed_command('filetype on')
+ feed_command('syntax on')
+ feed_command('set cursorline ft=json')
+ feed('i{<cr>"a" : abc // 10;<cr>}<cr><esc>')
+ screen:expect([[
+ {1:{} |
+ "{2:a}" : {3:abc} {3:// 10;} |
+ {1:}} |
+ {5:^ }|
+ |
+ ]])
+
+ feed_command('set colorcolumn=3')
+ feed('i <esc>')
+ screen:expect([[
+ {1:{} {7: } |
+ "{2:a}{7:"} : {3:abc} {3:// 10;} |
+ {1:}} {7: } |
+ {5: ^ }{7: }{5: }|
+ |
+ ]])
+ end)
+end)
+
+
describe("MsgSeparator highlight and msgsep fillchar", function()
before_each(clear)
it("works", function()