aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_display.vim
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 /src/nvim/testdir/test_display.vim
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 'src/nvim/testdir/test_display.vim')
-rw-r--r--src/nvim/testdir/test_display.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_display.vim b/src/nvim/testdir/test_display.vim
index 9f74d0a38a..094283a3a3 100644
--- a/src/nvim/testdir/test_display.vim
+++ b/src/nvim/testdir/test_display.vim
@@ -263,6 +263,27 @@ func Test_display_scroll_at_topline()
call StopVimInTerminal(buf)
endfunc
+func Test_display_scroll_update_visual()
+ CheckScreendump
+
+ let lines =<< trim END
+ 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
+ END
+ call writefile(lines, 'XupdateVisual.vim')
+
+ let buf = RunVimInTerminal('-S XupdateVisual.vim', #{rows: 8, cols: 60})
+ call term_sendkeys(buf, "VG7kk")
+ call VerifyScreenDump(buf, 'Test_display_scroll_update_visual', {})
+
+ call StopVimInTerminal(buf)
+ call delete('XupdateVisual.vim')
+endfunc
+
" Test for 'eob' (EndOfBuffer) item in 'fillchars'
func Test_eob_fillchars()
" default value (skipped)