diff src/testdir/test_display.vim @ 21590:5f4a188dead8 v8.2.1345

patch 8.2.1345: Redraw error when using visual block and scroll Commit: https://github.com/vim/vim/commit/f8992d47cd50494c64bb733329067c9de3c75200 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 1 19:14:13 2020 +0200 patch 8.2.1345: Redraw error when using visual block and scroll Problem: Redraw error when using visual block and scroll. Solution: Add check for w_topline. ( closes https://github.com/vim/vim/issues/6597)
author Bram Moolenaar <Bram@vim.org>
date Sat, 01 Aug 2020 19:15:03 +0200
parents c4bce986c31a
children 08940efa6b4e
line wrap: on
line diff
--- a/src/testdir/test_display.vim
+++ b/src/testdir/test_display.vim
@@ -220,3 +220,26 @@ func Test_unprintable_fileformats()
   call delete('Xmac.txt')
   call delete(filename)
 endfunc
+
+" Test for scrolling that modifies buffer during visual block
+func Test_visual_block_scroll()
+  CheckScreendump
+
+  let lines =<< trim END
+    source $VIMRUNTIME/plugin/matchparen.vim
+    set scrolloff=1
+    call setline(1, ['a', 'b', 'c', 'd', 'e', '', '{', '}', '{', 'f', 'g', '}'])
+    call cursor(5, 1)
+  END
+
+  let filename = 'Xvisualblockmodifiedscroll'
+  call writefile(lines, filename)
+
+  let buf = RunVimInTerminal('-S '.filename, #{rows: 7})
+  call term_sendkeys(buf, "V\<C-D>\<C-D>")
+
+  call VerifyScreenDump(buf, 'Test_display_visual_block_scroll', {})
+
+  call StopVimInTerminal(buf)
+  call delete(filename)
+endfunc