diff options
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 676afe9e91..3cf3636e23 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -3399,6 +3399,10 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist) width1 = curwin->w_width - col_off1; width2 = curwin->w_width - col_off2; + if (width2 == 0) { + width2 = 1; // Avoid divide by zero. + } + if (curwin->w_width != 0) { /* * Instead of sticking at the last character of the buffer line we |