diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-09-14 19:28:13 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2024-09-14 19:29:40 +0800 |
commit | 5191a11d66b925561b5f705aa42759a0e2a5624a (patch) | |
tree | 3717f8aff261d15a8afb68d8c0f8515cfe8d9e7f /src/nvim/drawline.c | |
parent | 90585e47feb7b4c4d878ad32480e2fc09744a7ed (diff) | |
download | rneovim-5191a11d66b925561b5f705aa42759a0e2a5624a.tar.gz rneovim-5191a11d66b925561b5f705aa42759a0e2a5624a.tar.bz2 rneovim-5191a11d66b925561b5f705aa42759a0e2a5624a.zip |
vim-patch:9.1.0730: Crash with cursor-screenline and narrow window
Problem: Crash with cursor-screenline and narrow window
(elig0n)
Solution: Don't set right_col when width2 is 0 (zeertzjq).
fixes: vim/vim#15677
closes: vim/vim#15678
https://github.com/vim/vim/commit/59149f02692804267e7cc0665d0334f6ff4675be
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r-- | src/nvim/drawline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index c85b9d2288..3b88dd2e90 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -189,7 +189,7 @@ static void margin_columns_win(win_T *wp, int *left_col, int *right_col) *left_col = 0; *right_col = width1; - if (wp->w_virtcol >= (colnr_T)width1) { + if (wp->w_virtcol >= (colnr_T)width1 && width2 > 0) { *right_col = width1 + ((wp->w_virtcol - width1) / width2 + 1) * width2; } if (wp->w_virtcol >= (colnr_T)width1 && width2 > 0) { |