aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-03-26 08:52:54 +0800
committerGitHub <noreply@github.com>2022-03-26 08:52:54 +0800
commit9530c2d6d82dbae1303e15608c56f4fefad312a9 (patch)
tree1dace261b44854b09fad2ce924b97e1f43f709a7 /test
parentc2378be3dd5cd7d97f7a22a2472fcee9992b1c31 (diff)
downloadrneovim-9530c2d6d82dbae1303e15608c56f4fefad312a9.tar.gz
rneovim-9530c2d6d82dbae1303e15608c56f4fefad312a9.tar.bz2
rneovim-9530c2d6d82dbae1303e15608c56f4fefad312a9.zip
vim-patch:8.2.4626: Visual area not updated when removing sign in Visual mode (#17864)
Problem: Visual area not fully updated when removing sign in Visual mode while scrolling. Solution: Adjust check for topline. (closes vim/vim#10017) https://github.com/vim/vim/commit/abb6fbd14d985b9b36a4e336d6edaf9853888ac1
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/display_spec.lua36
1 files changed, 33 insertions, 3 deletions
diff --git a/test/functional/legacy/display_spec.lua b/test/functional/legacy/display_spec.lua
index 3fbbe96947..59ba170e33 100644
--- a/test/functional/legacy/display_spec.lua
+++ b/test/functional/legacy/display_spec.lua
@@ -3,15 +3,15 @@ local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear = helpers.clear
local poke_eventloop = helpers.poke_eventloop
+local exec = helpers.exec
local feed = helpers.feed
local feed_command = helpers.feed_command
describe('display', function()
- local screen
+ before_each(clear)
it('scroll when modified at topline', function()
- clear()
- screen = Screen.new(20, 4)
+ local screen = Screen.new(20, 4)
screen:attach()
screen:set_default_attr_ids({
[1] = {bold = true},
@@ -27,5 +27,35 @@ describe('display', function()
{1:-- INSERT --} |
]])
end)
+
+ it('scrolling when modified at topline in Visual mode', function()
+ local screen = Screen.new(60, 8)
+ screen:attach()
+ screen:set_default_attr_ids({
+ [1] = {bold = true}, -- ModeMsg
+ [2] = {background = Screen.colors.LightGrey}, -- Visual
+ [3] = {background = Screen.colors.Grey, foreground = Screen.colors.DarkBlue}, -- SignColumn
+ })
+
+ exec([[
+ set scrolloff=0
+ call setline(1, repeat(['foo'], 10))
+ call sign_define('foo', { 'text': '>' })
+ call sign_place(1, 'bar', 'foo', bufnr(), { 'lnum': 2 })
+ call sign_place(2, 'bar', 'foo', bufnr(), { 'lnum': 1 })
+ autocmd CursorMoved * if getcurpos()[1] == 2 | call sign_unplace('bar', { 'id': 1 }) | endif
+ ]])
+ feed('VG7kk')
+ screen:expect([[
+ {3: }^f{2:oo} |
+ {3: }foo |
+ {3: }foo |
+ {3: }foo |
+ {3: }foo |
+ {3: }foo |
+ {3: }foo |
+ {1:-- VISUAL LINE --} |
+ ]])
+ end)
end)