diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-03-28 04:43:51 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-03-28 06:15:26 +0800 |
commit | 4baeb96c1bb66c845b4bc58482df4e601485eec3 (patch) | |
tree | 4a6bfbead593d25778826ceababf2d3222a51783 /test/functional/ui/highlight_spec.lua | |
parent | a201dd265f3f20be954d8b7ee7f65d3eb6f920f6 (diff) | |
download | rneovim-4baeb96c1bb66c845b4bc58482df4e601485eec3.tar.gz rneovim-4baeb96c1bb66c845b4bc58482df4e601485eec3.tar.bz2 rneovim-4baeb96c1bb66c845b4bc58482df4e601485eec3.zip |
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)
https://github.com/vim/vim/commit/3e559cd88486ffab6b6fb4e0921b4600d137a617
redraw_after_callback() is N/A.
Omits changes that just revert code from patch 8.2.4630.
Diffstat (limited to 'test/functional/ui/highlight_spec.lua')
-rw-r--r-- | test/functional/ui/highlight_spec.lua | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/test/functional/ui/highlight_spec.lua b/test/functional/ui/highlight_spec.lua index 559738ddab..2053901857 100644 --- a/test/functional/ui/highlight_spec.lua +++ b/test/functional/ui/highlight_spec.lua @@ -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() |