mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 9.0.2105: skipcol not reset when topline changed
Problem: Skipcol is not reset when topline changed scrolling cursor to top Solution: reset skipcol closes: #13528 closes: #13532 Signed-off-by: Luuk van Baal <luukvbaal@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
bc8f79d36a
commit
bb800a7907
@ -2423,7 +2423,9 @@ scroll_cursor_top(int min_scroll, int always)
|
|||||||
}
|
}
|
||||||
check_topfill(curwin, FALSE);
|
check_topfill(curwin, FALSE);
|
||||||
#endif
|
#endif
|
||||||
if (curwin->w_topline == curwin->w_cursor.lnum)
|
if (curwin->w_topline != old_topline)
|
||||||
|
reset_skipcol();
|
||||||
|
else if (curwin->w_topline == curwin->w_cursor.lnum)
|
||||||
{
|
{
|
||||||
validate_virtcol();
|
validate_virtcol();
|
||||||
if (curwin->w_skipcol >= curwin->w_virtcol)
|
if (curwin->w_skipcol >= curwin->w_virtcol)
|
||||||
|
12
src/testdir/dumps/Test_smoothscroll_cursor_top.dump
Normal file
12
src/testdir/dumps/Test_smoothscroll_cursor_top.dump
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
| +0&#ffffff0@39
|
||||||
|
|[+1&&|N|o| |N|a|m|e|]| @30
|
||||||
|
|l+0&&|i|n|e|1| @34
|
||||||
|
|l|i|n|e|2| @34
|
||||||
|
>l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3
|
||||||
|
|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3
|
||||||
|
|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3| @19
|
||||||
|
|l|i|n|e|4| @34
|
||||||
|
|~+0#4040ff13&| @38
|
||||||
|
|~| @38
|
||||||
|
|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @26
|
||||||
|
| +0&&@39
|
@ -909,4 +909,21 @@ func Test_smoothscroll_zero_width_scroll_cursor_bot()
|
|||||||
call StopVimInTerminal(buf)
|
call StopVimInTerminal(buf)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" scroll_cursor_top() should reset skipcol when it changes topline
|
||||||
|
func Test_smoothscroll_cursor_top()
|
||||||
|
CheckScreendump
|
||||||
|
|
||||||
|
let lines =<< trim END
|
||||||
|
set smoothscroll scrolloff=2
|
||||||
|
new | 11resize | wincmd j
|
||||||
|
call setline(1, ['line1', 'line2', 'line3'->repeat(20), 'line4'])
|
||||||
|
exe "norm G3\<C-E>k"
|
||||||
|
END
|
||||||
|
call writefile(lines, 'XSmoothScrollCursorTop', 'D')
|
||||||
|
let buf = RunVimInTerminal('-u NONE -S XSmoothScrollCursorTop', #{rows: 12, cols:40})
|
||||||
|
call VerifyScreenDump(buf, 'Test_smoothscroll_cursor_top', {})
|
||||||
|
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
endfunc
|
||||||
|
|
||||||
" vim: shiftwidth=2 sts=2 expandtab
|
" vim: shiftwidth=2 sts=2 expandtab
|
||||||
|
@ -704,6 +704,10 @@ 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 */
|
||||||
|
/**/
|
||||||
|
2105,
|
||||||
|
/**/
|
||||||
|
2104,
|
||||||
/**/
|
/**/
|
||||||
2103,
|
2103,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user