summaryrefslogtreecommitdiff
path: root/src/move.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-10-03 12:11:13 +0100
committerBram Moolenaar <Bram@vim.org>2022-10-03 12:11:13 +0100
commit8df9748edb2ac8bd025e34e06194ac210667c97a (patch)
tree995fad54ffc0479516c18392ad27c3053ab8d80f /src/move.c
parentb1fd26d208aadc96d3e8b9215f761150f40a9f91 (diff)
downloadvim-git-8df9748edb2ac8bd025e34e06194ac210667c97a.tar.gz
patch 9.0.0645: CTRL-Y does not stop at line 1v9.0.0645
Problem: CTRL-Y does not stop at line 1. (John Marriott) Solution: Stop at line 1 when 'smoothscroll' is not set. (closes #11261)
Diffstat (limited to 'src/move.c')
-rw-r--r--src/move.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/move.c b/src/move.c
index dca77f787..43e3273e2 100644
--- a/src/move.c
+++ b/src/move.c
@@ -1485,11 +1485,14 @@ scrolldown(
else
#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;
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)
curwin->w_skipcol -= width2;
else
@@ -1499,6 +1502,7 @@ scrolldown(
}
else
{
+ // scroll a text line down
--curwin->w_topline;
curwin->w_skipcol = 0;
#ifdef FEAT_DIFF