aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/move.c')
-rw-r--r--src/nvim/move.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index 078ce3d72c..66667cecc4 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -1974,11 +1974,13 @@ void scroll_cursor_bot(win_T *wp, int min_scroll, bool set_topbot)
// need to scroll the additional clipped lines to scroll past the
// top line before we can move on to the other lines.
int top_plines = plines_win_nofill(wp, wp->w_topline, false);
- int skip_lines = 0;
int width1 = wp->w_width_inner - win_col_off(wp);
+
if (width1 > 0) {
int width2 = width1 + win_col_off2(wp);
- // similar formula is used in curs_columns()
+ int skip_lines = 0;
+
+ // A similar formula is used in curs_columns().
if (wp->w_skipcol > width1) {
skip_lines += (wp->w_skipcol - width1) / width2 + 1;
} else if (wp->w_skipcol > 0) {