Problem: Crash when deleting buffers in diff mode.
Solution: Recompute diffs later. Skip window without a valid buffer.
tp->tp_diffbuf[i] = NULL;
tp->tp_diff_invalid = TRUE;
if (tp == curtab)
- diff_redraw(TRUE);
+ {
+ // don't redraw right away, more might change or buffer state
+ // is invalid right now
+ need_diff_redraw = TRUE;
+ redraw_later(VALID);
+ }
}
}
}
need_diff_redraw = FALSE;
FOR_ALL_WINDOWS(wp)
- if (wp->w_p_diff)
+ // when closing windows or wiping buffers skip invalid window
+ if (wp->w_p_diff && buf_valid(wp->w_buffer))
{
redraw_win_later(wp, SOME_VALID);
if (wp != curwin)
call delete('Xright')
endfunc
+" This was trying to update diffs for a buffer being closed
+func Test_diff_only()
+ silent! lfile
+ set diff
+ lopen
+ norm \17\18\17\ eo
+ silent! norm \17\ e\17o
+
+ set nodiff
+ %bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 5163,
/**/
5162,
/**/