aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/move.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-05-16 05:36:24 +0800
committerGitHub <noreply@github.com>2024-05-16 05:36:24 +0800
commitacaac07b64d9549553470ae273acecf888f67787 (patch)
tree6b2f2a2075187181d8f83512bda43e0a01aecb7f /src/nvim/move.c
parentcdd87222c86c5b2274a13d36f23de0637462e317 (diff)
downloadrneovim-acaac07b64d9549553470ae273acecf888f67787.tar.gz
rneovim-acaac07b64d9549553470ae273acecf888f67787.tar.bz2
rneovim-acaac07b64d9549553470ae273acecf888f67787.zip
vim-patch:9.1.0413: smoothscroll may cause infinite loop (#28763)
Problem: smoothscroll may cause infinite loop, with very narrow windows (Jaehwang Jung, after v9.1.0280) Solution: Check for width1 being negative, verify that win_linetabsize does not overflow fixes: vim/vim#14750 closes: vim/vim#14772 https://github.com/vim/vim/commit/eff20eb35d2dba413c6d115291dd9ddea705e802 Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/nvim/move.c')
-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 b07bc33b17..ef4346da76 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -1219,7 +1219,7 @@ static void cursor_correct_sms(win_T *wp)
}
// Not enough screen lines in topline: ignore 'scrolloff'.
- while (so_cols > size && so_cols - width2 >= width1) {
+ while (so_cols > size && so_cols - width2 >= width1 && width1 > 0) {
so_cols -= width2;
}
if (so_cols >= width1 && so_cols > size) {