# HG changeset patch # User Bram Moolenaar # Date 1668712506 -3600 # Node ID 92b929203a4fc5e83e874e25b47e86230416cf1a # Parent 9f8f5c88f1576789cc3a2e87a9d9a0cc4967d0e4 patch 9.0.0898: with 'smoothscroll' cursor is one screen line too far down Commit: https://github.com/vim/vim/commit/75ac25b4967cdcdfdf2d6c086a6e2308868c280a Author: Bram Moolenaar Date: Thu Nov 17 19:00:14 2022 +0000 patch 9.0.0898: with 'smoothscroll' cursor is one screen line too far down 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) diff --git a/src/testdir/dumps/Test_smooth_long_showbreak_1.dump b/src/testdir/dumps/Test_smooth_long_showbreak_1.dump new file mode 100644 --- /dev/null +++ b/src/testdir/dumps/Test_smooth_long_showbreak_1.dump @@ -0,0 +1,6 @@ +>w+0&#ffffff0|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| +|++0#4040ff13&@2| |o+0#0000000&|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x +|++0#4040ff13&@2| |t+0#0000000&| |i|n| |o|n|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o +|++0#4040ff13&@2| |n+0#0000000&|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n +|++0#4040ff13&@2| |e+0#0000000&| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e| @4 +@22|1|,|1| @10|A|l@1| diff --git a/src/testdir/dumps/Test_smooth_long_showbreak_2.dump b/src/testdir/dumps/Test_smooth_long_showbreak_2.dump new file mode 100644 --- /dev/null +++ b/src/testdir/dumps/Test_smooth_long_showbreak_2.dump @@ -0,0 +1,6 @@ +|++0#4040ff13#ffffff0@2| |o+0#0000000&|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x +|++0#4040ff13&@2| >t+0#0000000&| |i|n| |o|n|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o +|++0#4040ff13&@2| |n+0#0000000&|e| |l|i|n|e| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n +|++0#4040ff13&@2| |e+0#0000000&| |w|i|t|h| |l|o|t|s| |o|f| |t|e|x|t| |i|n| |o|n|e| |l|i|n|e| @4 +|~+0#4040ff13&| @38 +| +0#0000000&@21|1|,|7@1|-|8|5| @6|A|l@1| diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim --- 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, "\") + 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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -696,6 +696,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 898, +/**/ 897, /**/ 896,