0
0
mirror of https://github.com/vim/vim.git synced 2025-10-24 08:54:47 -04:00

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: #15677
closes: #15678

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-09-14 10:40:29 +02:00
committed by Christian Brabandt
parent 86dc4f8b43
commit 59149f0269
3 changed files with 14 additions and 1 deletions

View File

@@ -62,7 +62,7 @@ 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)
*left_col = (wp->w_virtcol - width1) / width2 * width2 + width1;