summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_scroll_opt.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-11-17 19:00:14 +0000
committerBram Moolenaar <Bram@vim.org>2022-11-17 19:00:14 +0000
commit75ac25b4967cdcdfdf2d6c086a6e2308868c280a (patch)
tree6f9445153a4306764f8a7324c133c8254bed1b35 /src/testdir/test_scroll_opt.vim
parent12babe45a389cd1ea8befd5b06239e877b4abbba (diff)
patch 9.0.0898: with 'smoothscroll' cursor is one screen line too far downv9.0.0898
Problem: With 'smoothscroll' cursor is one screen line too far down. (Ernie Rael) Solution: Add a test that currently has the wrong result so that a fix can be made. (issue #11436)
Diffstat (limited to 'src/testdir/test_scroll_opt.vim')
-rw-r--r--src/testdir/test_scroll_opt.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim
index d863d039ba..76853afebe 100644
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -308,6 +308,29 @@ func Test_smoothscroll_one_long_line()
call StopVimInTerminal(buf)
endfunc
+func Test_smoothscroll_long_line_showbreak()
+ CheckScreendump
+
+ let lines =<< trim END
+ vim9script
+ # a line that spans four screen lines
+ setline(1, 'with lots of text in one line '->repeat(6))
+ set smoothscroll scrolloff=0 showbreak=+++\
+ END
+ call writefile(lines, 'XSmoothLongShowbreak', 'D')
+ let buf = RunVimInTerminal('-S XSmoothLongShowbreak', #{rows: 6, cols: 40})
+ call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_1', {})
+
+ " FIXME: this currently has the cursor in screen line 2, should be one up.
+ call term_sendkeys(buf, "\<C-E>")
+ call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_2', {})
+
+ call term_sendkeys(buf, "0")
+ call VerifyScreenDump(buf, 'Test_smooth_long_showbreak_1', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" Test that if the current cursor is on a smooth scrolled line, we correctly
" reposition it. Also check that we don't miscalculate the values by checking
" the consistency between wincol() and col('.') as they are calculated