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>
*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;
call StopVimInTerminal(buf)
endfunc
+func Test_cursorline_screenline_zero_width()
+ CheckOption foldcolumn
+
+ set cursorline culopt=screenline winminwidth=1 foldcolumn=1
+ " This used to crash Vim
+ 1vnew | redraw
+
+ bwipe!
+ set cursorline& culopt& winminwidth& foldcolumn&
+endfunc
+
func Test_cursorline_cursorbind_horizontal_scroll()
CheckScreendump
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 730,
/**/
729,
/**/