mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.2.5163: crash when deleting buffers in diff mode
Problem: Crash when deleting buffers in diff mode. Solution: Recompute diffs later. Skip window without a valid buffer.
This commit is contained in:
10
src/diff.c
10
src/diff.c
@@ -119,7 +119,12 @@ diff_buf_delete(buf_T *buf)
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -670,7 +675,8 @@ diff_redraw(
|
||||
|
||||
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)
|
||||
|
Reference in New Issue
Block a user