summaryrefslogtreecommitdiffstats
path: root/src/diff.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-12-01 20:35:58 +0100
committerBram Moolenaar <Bram@vim.org>2017-12-01 20:35:58 +0100
commit97ce419201421f65f4764549ed80307a7ef9c7a6 (patch)
tree0ba380c7872e3fed3b109a4af087b7c3b4417e73 /src/diff.c
parent76bb7196f5102c9929959d710e8ed97a19affa4d (diff)
patch 8.0.1361: some users don't want to diff with hidden buffersv8.0.1361
Problem: Some users don't want to diff with hidden buffers. Solution: Add the "hiddenoff" item to 'diffopt'. (Alisue, closes #2394)
Diffstat (limited to 'src/diff.c')
-rw-r--r--src/diff.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/diff.c b/src/diff.c
index 11952c7433..2f5b38c7b3 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -23,6 +23,7 @@ static int diff_busy = FALSE; /* ex_diffgetput() is busy */
#define DIFF_IWHITE 4 /* ignore change in white space */
#define DIFF_HORIZONTAL 8 /* horizontal splits */
#define DIFF_VERTICAL 16 /* vertical splits */
+#define DIFF_HIDDEN_OFF 32 /* diffoff when hidden */
static int diff_flags = DIFF_FILLER;
#define LBUFLEN 50 /* length of line in diff file */
@@ -1924,6 +1925,11 @@ diffopt_changed(void)
p += 11;
diff_foldcolumn_new = getdigits(&p);
}
+ else if (STRNCMP(p, "hiddenoff", 9) == 0)
+ {
+ p += 9;
+ diff_flags_new |= DIFF_HIDDEN_OFF;
+ }
if (*p != ',' && *p != NUL)
return FAIL;
if (*p == ',')
@@ -1962,6 +1968,15 @@ diffopt_horizontal(void)
}
/*
+ * Return TRUE if 'diffopt' contains "hiddenoff".
+ */
+ int
+diffopt_hiddenoff(void)
+{
+ return (diff_flags & DIFF_HIDDEN_OFF) != 0;
+}
+
+/*
* Find the difference within a changed line.
* Returns TRUE if the line was added, no other buffer has it.
*/