aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2021-08-27 20:50:37 +0800
committerGitHub <noreply@github.com>2021-08-27 05:50:37 -0700
commit32024787b6b1ef39c23bda1653c23b5dfbde9e81 (patch)
treeca42840d15eac7d352d7f8c101da1b866168b554 /test/functional
parent08e223cebb8916f01270b5a332e6202df58609a9 (diff)
downloadrneovim-32024787b6b1ef39c23bda1653c23b5dfbde9e81.tar.gz
rneovim-32024787b6b1ef39c23bda1653c23b5dfbde9e81.tar.bz2
rneovim-32024787b6b1ef39c23bda1653c23b5dfbde9e81.zip
vim-patch:8.1.2229: color number column above/below cursor #15409
Problem: Cannot color number column above/below cursor differently. Solution: Add LineNrAbove and LineNrBelow. (Shaun Brady, closes vim/vim#624) https://github.com/vim/vim/commit/efae76ab1a43d5a628d8c2fa4218ace6ba597f5d
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/ui/cursor_spec.lua4
-rw-r--r--test/functional/ui/highlight_spec.lua69
2 files changed, 71 insertions, 2 deletions
diff --git a/test/functional/ui/cursor_spec.lua b/test/functional/ui/cursor_spec.lua
index f75f700fb5..9c035c728b 100644
--- a/test/functional/ui/cursor_spec.lua
+++ b/test/functional/ui/cursor_spec.lua
@@ -212,10 +212,10 @@ describe('ui/cursor', function()
if m.blinkwait then m.blinkwait = 700 end
end
if m.hl_id then
- m.hl_id = 56
+ m.hl_id = 58
m.attr = {background = Screen.colors.DarkGray}
end
- if m.id_lm then m.id_lm = 57 end
+ if m.id_lm then m.id_lm = 59 end
end
-- Assert the new expectation.
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua
index 499aeba6ec..c00d30fe32 100644
--- a/test/functional/ui/highlight_spec.lua
+++ b/test/functional/ui/highlight_spec.lua
@@ -1292,6 +1292,75 @@ describe("MsgSeparator highlight and msgsep fillchar", function()
end)
end)
+describe("'number' and 'relativenumber' highlight", function()
+ before_each(clear)
+
+ it('LineNr, LineNrAbove and LineNrBelow', function()
+ local screen = Screen.new(20,10)
+ screen:set_default_attr_ids({
+ [1] = {foreground = Screen.colors.Red},
+ [2] = {foreground = Screen.colors.Blue},
+ [3] = {foreground = Screen.colors.Green},
+ })
+ screen:attach()
+ command('set number relativenumber')
+ command('call setline(1, range(50))')
+ command('highlight LineNr guifg=Red')
+ feed('4j')
+ screen:expect([[
+ {1: 4 }0 |
+ {1: 3 }1 |
+ {1: 2 }2 |
+ {1: 1 }3 |
+ {1:5 }^4 |
+ {1: 1 }5 |
+ {1: 2 }6 |
+ {1: 3 }7 |
+ {1: 4 }8 |
+ |
+ ]])
+ command('highlight LineNrAbove guifg=Blue')
+ screen:expect([[
+ {2: 4 }0 |
+ {2: 3 }1 |
+ {2: 2 }2 |
+ {2: 1 }3 |
+ {1:5 }^4 |
+ {1: 1 }5 |
+ {1: 2 }6 |
+ {1: 3 }7 |
+ {1: 4 }8 |
+ |
+ ]])
+ command('highlight LineNrBelow guifg=Green')
+ screen:expect([[
+ {2: 4 }0 |
+ {2: 3 }1 |
+ {2: 2 }2 |
+ {2: 1 }3 |
+ {1:5 }^4 |
+ {3: 1 }5 |
+ {3: 2 }6 |
+ {3: 3 }7 |
+ {3: 4 }8 |
+ |
+ ]])
+ feed('3j')
+ screen:expect([[
+ {2: 7 }0 |
+ {2: 6 }1 |
+ {2: 5 }2 |
+ {2: 4 }3 |
+ {2: 3 }4 |
+ {2: 2 }5 |
+ {2: 1 }6 |
+ {1:8 }^7 |
+ {3: 1 }8 |
+ |
+ ]])
+ end)
+end)
+
describe("'winhighlight' highlight", function()
local screen