diff src/testdir/test_cursorline.vim @ 28542:51b5cab35afa v8.2.4795

patch 8.2.4795: 'cursorbind' scrolling depends on whether 'cursorline' is set Commit: https://github.com/vim/vim/commit/2c645e8b00641f504072f35e061b7392ed41f491 Author: Christian Brabandt <cb@256bit.org> Date: Wed Apr 20 14:52:01 2022 +0100 patch 8.2.4795: 'cursorbind' scrolling depends on whether 'cursorline' is set Problem: 'cursorbind' scrolling depends on whether 'cursorline' is set. Solution: Always call validate_cursor(). (Christian Brabandt, closes https://github.com/vim/vim/issues/10230, closes #10014)
author Bram Moolenaar <Bram@vim.org>
date Wed, 20 Apr 2022 16:00:04 +0200
parents cbaac8434e4a
children 22345596a270
line wrap: on
line diff
--- a/src/testdir/test_cursorline.vim
+++ b/src/testdir/test_cursorline.vim
@@ -293,5 +293,37 @@ func Test_cursorline_screenline_update()
   call delete('Xcul_screenline')
 endfunc
 
+func Test_cursorline_cursorbind_horizontal_scroll()
+  CheckScreendump
+
+  let lines =<< trim END
+      call setline(1, 'aa bb cc dd ee ff gg hh ii jj kk ll mm' .. 
+      \ ' nn oo pp qq rr ss tt uu vv ww xx yy zz')
+      set nowrap
+      " The following makes the cursor apparent on the screen dump
+      set sidescroll=1 cursorcolumn
+      " add empty lines, required for cursorcolumn
+      call append(1, ['','','',''])
+      20vsp
+      windo :set cursorbind
+  END
+  call writefile(lines, 'Xhor_scroll')
+
+  let buf = RunVimInTerminal('-S Xhor_scroll', #{rows: 8})
+  call term_sendkeys(buf, "20l")
+  call VerifyScreenDump(buf, 'Test_hor_scroll_1', {})
+  call term_sendkeys(buf, "10l")
+  call VerifyScreenDump(buf, 'Test_hor_scroll_2', {})
+  call term_sendkeys(buf, ":windo :set cursorline\<cr>")
+  call term_sendkeys(buf, "0")
+  call term_sendkeys(buf, "20l")
+  call VerifyScreenDump(buf, 'Test_hor_scroll_3', {})
+  call term_sendkeys(buf, "10l")
+  call VerifyScreenDump(buf, 'Test_hor_scroll_4', {})
+
+  call StopVimInTerminal(buf)
+  "call delete('Xhor_scroll')
+endfunc
+
 
 " vim: shiftwidth=2 sts=2 expandtab