diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-11-17 19:00:14 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-11-17 19:00:14 +0000 |
commit | 75ac25b4967cdcdfdf2d6c086a6e2308868c280a (patch) | |
tree | 6f9445153a4306764f8a7324c133c8254bed1b35 /src | |
parent | 12babe45a389cd1ea8befd5b06239e877b4abbba (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')
-rw-r--r-- | src/testdir/dumps/Test_smooth_long_showbreak_1.dump | 6 | ||||
-rw-r--r-- | src/testdir/dumps/Test_smooth_long_showbreak_2.dump | 6 | ||||
-rw-r--r-- | src/testdir/test_scroll_opt.vim | 23 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 37 insertions, 0 deletions
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 index 0000000000..0071dee59a --- /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 index 0000000000..9f213bbde3 --- /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 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 diff --git a/src/version.c b/src/version.c index 1f795627d1..575f8d9764 100644 --- 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, |