summaryrefslogtreecommitdiff
path: root/src/diff.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-02-03 23:16:28 +0100
committerBram Moolenaar <Bram@vim.org>2017-02-03 23:16:28 +0100
commit25ea0544587dd45088512fec9d7a685e35fea679 (patch)
tree0038abd019ded330eb77ba548b1bbd24a343f1b3 /src/diff.c
parent6b40f303291be6b2fe524b5708e089773048c269 (diff)
downloadvim-git-25ea0544587dd45088512fec9d7a685e35fea679.tar.gz
patch 8.0.0300: cannot stop diffing hidden buffersv8.0.0300
Problem: Cannot stop diffing hidden buffers. (Daniel Hahler) Solution: When using :diffoff! make the whole list if diffed buffers empty. (closes #736)
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/diff.c b/src/diff.c
index a4a2acb95..8d7421dd7 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -139,6 +139,23 @@ diff_buf_add(buf_T *buf)
}
/*
+ * 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)