mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 8.0.0300: cannot stop diffing hidden buffers
Problem: Cannot stop diffing hidden buffers. (Daniel Hahler) Solution: When using :diffoff! make the whole list if diffed buffers empty. (closes #736)
This commit is contained in:
21
src/diff.c
21
src/diff.c
@@ -138,6 +138,23 @@ diff_buf_add(buf_T *buf)
|
||||
EMSGN(_("E96: Cannot diff more than %ld buffers"), DB_COUNT);
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove all buffers to make diffs for.
|
||||
*/
|
||||
static void
|
||||
diff_buf_clear(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < DB_COUNT; ++i)
|
||||
if (curtab->tp_diffbuf[i] != NULL)
|
||||
{
|
||||
curtab->tp_diffbuf[i] = NULL;
|
||||
curtab->tp_diff_invalid = TRUE;
|
||||
diff_redraw(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Find buffer "buf" in the list of diff buffers for the current tab page.
|
||||
* Return its index or DB_COUNT if not found.
|
||||
@@ -1257,6 +1274,10 @@ ex_diffoff(exarg_T *eap)
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Also remove hidden buffers from the list. */
|
||||
if (eap->forceit)
|
||||
diff_buf_clear();
|
||||
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
/* Remove "hor" from from 'scrollopt' if there are no diff windows left. */
|
||||
if (!diffwin && vim_strchr(p_sbo, 'h') != NULL)
|
||||
|
Reference in New Issue
Block a user