Mercurial > vim
changeset 31127:92b929203a4f v9.0.0898
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 <Bram@vim.org>
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)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 17 Nov 2022 20:15:06 +0100 |
parents | 9f8f5c88f157 |
children | bb1964a6cf1c |
files | src/testdir/dumps/Test_smooth_long_showbreak_1.dump src/testdir/dumps/Test_smooth_long_showbreak_2.dump src/testdir/test_scroll_opt.vim src/version.c |
diffstat | 4 files changed, 37 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
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|
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|
--- 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