mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 9.0.0645: CTRL-Y does not stop at line 1
Problem: CTRL-Y does not stop at line 1. (John Marriott) Solution: Stop at line 1 when 'smoothscroll' is not set. (closes #11261)
This commit is contained in:
@@ -1485,11 +1485,14 @@ scrolldown(
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (curwin->w_topline == 1 && curwin->w_skipcol < width1)
|
// break when at the very top
|
||||||
|
if (curwin->w_topline == 1
|
||||||
|
&& (!curwin->w_p_sms || curwin->w_skipcol < width1))
|
||||||
break;
|
break;
|
||||||
if (curwin->w_p_wrap && curwin->w_p_sms
|
if (curwin->w_p_wrap && curwin->w_p_sms
|
||||||
&& curwin->w_skipcol >= width1)
|
&& curwin->w_skipcol >= width1)
|
||||||
{
|
{
|
||||||
|
// scroll a screen line down
|
||||||
if (curwin->w_skipcol >= width1 + width2)
|
if (curwin->w_skipcol >= width1 + width2)
|
||||||
curwin->w_skipcol -= width2;
|
curwin->w_skipcol -= width2;
|
||||||
else
|
else
|
||||||
@@ -1499,6 +1502,7 @@ scrolldown(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// scroll a text line down
|
||||||
--curwin->w_topline;
|
--curwin->w_topline;
|
||||||
curwin->w_skipcol = 0;
|
curwin->w_skipcol = 0;
|
||||||
#ifdef FEAT_DIFF
|
#ifdef FEAT_DIFF
|
||||||
|
@@ -37,6 +37,19 @@ func Test_reset_scroll()
|
|||||||
quit!
|
quit!
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_CtrlE_CtrlY_stop_at_end()
|
||||||
|
enew
|
||||||
|
call setline(1, ['one', 'two'])
|
||||||
|
set number
|
||||||
|
exe "normal \<C-Y>"
|
||||||
|
call assert_equal([" 1 one "], ScreenLines(1, 10))
|
||||||
|
exe "normal \<C-E>\<C-E>\<C-E>"
|
||||||
|
call assert_equal([" 2 two "], ScreenLines(1, 10))
|
||||||
|
|
||||||
|
bwipe!
|
||||||
|
set nonumber
|
||||||
|
endfunc
|
||||||
|
|
||||||
func Test_smoothscroll_CtrlE_CtrlY()
|
func Test_smoothscroll_CtrlE_CtrlY()
|
||||||
CheckScreendump
|
CheckScreendump
|
||||||
|
|
||||||
|
@@ -699,6 +699,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 */
|
||||||
|
/**/
|
||||||
|
645,
|
||||||
/**/
|
/**/
|
||||||
644,
|
644,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user