1
0
forked from aniani/vim

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)
This commit is contained in:
Bram Moolenaar
2022-11-17 19:00:14 +00:00
parent 12babe45a3
commit 75ac25b496
4 changed files with 37 additions and 0 deletions

View File

@@ -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|

View File

@@ -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|

View File

@@ -308,6 +308,29 @@ func Test_smoothscroll_one_long_line()
call StopVimInTerminal(buf) call StopVimInTerminal(buf)
endfunc 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 " 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 " reposition it. Also check that we don't miscalculate the values by checking
" the consistency between wincol() and col('.') as they are calculated " the consistency between wincol() and col('.') as they are calculated

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
898,
/**/ /**/
897, 897,
/**/ /**/