vim-patch:8.2.4638: superfluous check if a redraw is needed for 'cursorline'

Problem:    Superfluous check if a redraw is needed for 'cursorline'.
Solution:   Remove check_redraw_cursorline(). (closes vim/vim#10030, closes vim/vim#10029)
3e559cd884

redraw_after_callback() is N/A.
Omits changes that just revert code from patch 8.2.4630.
This commit is contained in:
zeertzjq
2022-03-28 04:43:51 +08:00
parent a201dd265f
commit 4baeb96c1b
6 changed files with 152 additions and 26 deletions

View File

@@ -1266,6 +1266,49 @@ describe('CursorLine and CursorLineNr highlights', function()
end)
end)
describe('CursorColumn highlight', function()
before_each(clear)
it('is updated if cursor is moved from timer', function()
local screen = Screen.new(50, 8)
screen:set_default_attr_ids({
[1] = {background = Screen.colors.Gray90}, -- CursorColumn
[2] = {bold = true, foreground = Screen.colors.Blue1}, -- NonText
})
screen:attach()
exec([[
call setline(1, ['aaaaa', 'bbbbb', 'ccccc', 'ddddd'])
set cursorcolumn
call cursor(4, 5)
func Func(timer)
call cursor(1, 1)
endfunc
call timer_start(300, 'Func')
]])
screen:expect({grid = [[
aaaa{1:a} |
bbbb{1:b} |
cccc{1:c} |
dddd^d |
{2:~ }|
{2:~ }|
{2:~ }|
|
]], timeout = 100})
screen:expect({grid = [[
^aaaaa |
{1:b}bbbb |
{1:c}cccc |
{1:d}dddd |
{2:~ }|
{2:~ }|
{2:~ }|
|
]]})
end)
end)
describe('ColorColumn highlight', function()
local screen
@@ -1570,6 +1613,46 @@ describe("'number' and 'relativenumber' highlight", function()
|
]])
end)
it('relative number highlight is updated if cursor is moved from timer', function()
local screen = Screen.new(50, 8)
screen:set_default_attr_ids({
[1] = {foreground = Screen.colors.Brown}, -- LineNr
[2] = {bold = true, foreground = Screen.colors.Blue1}, -- NonText
})
screen:attach()
exec([[
call setline(1, ['aaaaa', 'bbbbb', 'ccccc', 'ddddd'])
set relativenumber
call cursor(4, 1)
func Func(timer)
call cursor(1, 1)
endfunc
call timer_start(300, 'Func')
]])
screen:expect({grid = [[
{1: 3 }aaaaa |
{1: 2 }bbbbb |
{1: 1 }ccccc |
{1: 0 }^ddddd |
{2:~ }|
{2:~ }|
{2:~ }|
|
]], timeout = 100})
screen:expect({grid = [[
{1: 0 }^aaaaa |
{1: 1 }bbbbb |
{1: 2 }ccccc |
{1: 3 }ddddd |
{2:~ }|
{2:~ }|
{2:~ }|
|
]]})
end)
end)
describe("'winhighlight' highlight", function()