vim-patch:9.0.1367: divide by zero in zero-width window

Problem:    Divide by zero in zero-width window.
Solution:   Check the width is positive.

e0f8691969

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Luuk van Baal
2023-04-29 00:16:37 +02:00
parent 4e4383ffa2
commit 7d5673b18b
2 changed files with 30 additions and 11 deletions

View File

@@ -1303,7 +1303,7 @@ bool scrolldown(long line_count, int byfold)
col -= width1;
row++;
}
if (col > width2) {
if (col > width2 && width2 > 0) {
row += (int)col / width2;
col = col % width2;
}