aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 54ca216a53..eb680203f7 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -5122,11 +5122,13 @@ static void nv_scroll(cmdarg_T *cap)
--n;
break;
}
- used += plines(curwin->w_topline + n);
- if (used >= half)
+ used += plines_win(curwin, curwin->w_topline + n, true);
+ if (used >= half) {
break;
- if (hasFolding(curwin->w_topline + n, NULL, &lnum))
+ }
+ if (hasFolding(curwin->w_topline + n, NULL, &lnum)) {
n = lnum - curwin->w_topline;
+ }
}
if (n > 0 && used > curwin->w_height_inner) {
n--;