diff options
author | shade-of-noon <73705427+shade-of-noon@users.noreply.github.com> | 2020-11-25 11:47:03 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 16:47:03 +0100 |
commit | 2d5dd85eef3be0a0a4073964ddbb849c586bc6a1 (patch) | |
tree | 59546b7b3221d40efa0fc87b9715dfecd513a9cd /test/functional/ui/highlight_spec.lua | |
parent | 104749440d2c6997d2f76469866537be785a1614 (diff) | |
download | rneovim-2d5dd85eef3be0a0a4073964ddbb849c586bc6a1.tar.gz rneovim-2d5dd85eef3be0a0a4073964ddbb849c586bc6a1.tar.bz2 rneovim-2d5dd85eef3be0a0a4073964ddbb849c586bc6a1.zip |
screen.c: Allow showbreak to override cursorline. (#13372)
I also added relevant tests.
Close #13369
Diffstat (limited to 'test/functional/ui/highlight_spec.lua')
-rw-r--r-- | test/functional/ui/highlight_spec.lua | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 28e4e88326..ef3acd7d2e 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -604,7 +604,7 @@ describe("'listchars' highlight", function() ]]) end) - it("'cursorline' and with 'listchar' option: space, eol, tab, and trail", function() + it("'cursorline' and with 'listchars' option", function() screen:set_default_attr_ids({ [1] = {background=Screen.colors.Grey90}, [2] = { @@ -861,6 +861,57 @@ describe('CursorLine highlight', function() ]]) end) + it("overridden by NonText in 'showbreak' characters", function() + local screen = Screen.new(20,5) + screen:set_default_attr_ids({ + [1] = {foreground = Screen.colors.Yellow, background = Screen.colors.Blue}; + [2] = {foreground = Screen.colors.Black, background = Screen.colors.White}; + [3] = {foreground = Screen.colors.Yellow, background = Screen.colors.White}; + [4] = {foreground = Screen.colors.Yellow}; + }) + screen:attach() + + feed_command('set wrap cursorline') + feed_command('set showbreak=>>>') + feed_command('highlight clear NonText') + feed_command('highlight clear CursorLine') + feed_command('highlight NonText guifg=Yellow guibg=Blue gui=NONE') + feed_command('highlight CursorLine guifg=Black guibg=White gui=NONE') + + feed('30iø<esc>o<esc>30ia<esc>') + screen:expect([[ + øøøøøøøøøøøøøøøøøøøø| + {1:>>>}øøøøøøøøøø | + {2:aaaaaaaaaaaaaaaaaaaa}| + {1:>>>}{2:aaaaaaaaa^a }| + | + ]]) + feed('k') + screen:expect([[ + {2:øøøøøøøøøøøøøøøøøøøø}| + {1:>>>}{2:øøøøøøøøø^ø }| + aaaaaaaaaaaaaaaaaaaa| + {1:>>>}aaaaaaaaaa | + | + ]]) + feed_command('highlight NonText guibg=NONE') + screen:expect([[ + {2:øøøøøøøøøøøøøøøøøøøø}| + {3:>>>}{2:øøøøøøøøø^ø }| + aaaaaaaaaaaaaaaaaaaa| + {4:>>>}aaaaaaaaaa | + | + ]]) + feed_command('set nocursorline') + screen:expect([[ + øøøøøøøøøøøøøøøøøøøø| + {4:>>>}øøøøøøøøø^ø | + aaaaaaaaaaaaaaaaaaaa| + {4:>>>}aaaaaaaaaa | + :set nocursorline | + ]]) + end) + it('always updated. vim-patch:8.1.0849', function() local screen = Screen.new(50,5) screen:set_default_attr_ids({ |