aboutsummaryrefslogtreecommitdiff
path: root/src/nvim
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-04-29 00:16:37 +0200
committerLuuk van Baal <luukvbaal@gmail.com>2023-05-02 13:11:47 +0200
commit7d5673b18b8b4ff085473b40fce317e760e48ce3 (patch)
tree31573d1779702caeeafe8ca24cbd7989ada68baf /src/nvim
parent4e4383ffa2b9ec94e703ecbd6178737fc24f6866 (diff)
downloadrneovim-7d5673b18b8b4ff085473b40fce317e760e48ce3.tar.gz
rneovim-7d5673b18b8b4ff085473b40fce317e760e48ce3.tar.bz2
rneovim-7d5673b18b8b4ff085473b40fce317e760e48ce3.zip
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. https://github.com/vim/vim/commit/e0f869196930ef5f25a0ac41c9215b09c9ce2d3c Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim')
-rw-r--r--src/nvim/move.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c
index e635b381d3..69245f2a67 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -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;
}