1
0
forked from aniani/vim

patch 8.0.1361: some users don't want to diff with hidden buffers

Problem:    Some users don't want to diff with hidden buffers.
Solution:   Add the "hiddenoff" item to 'diffopt'. (Alisue, closes #2394)
This commit is contained in:
Bram Moolenaar
2017-12-01 20:35:58 +01:00
parent 76bb7196f5
commit 97ce419201
6 changed files with 49 additions and 0 deletions

View File

@@ -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 == ',')
@@ -1961,6 +1967,15 @@ diffopt_horizontal(void)
return (diff_flags & DIFF_HORIZONTAL) != 0;
}
/*
* 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.