aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-11 14:55:02 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-11 15:06:07 -0400
commit594536a1e71c90fd558501a675c459b8c7c242ea (patch)
tree72b8a8a464da5f29a4909e8db8b917c08a4de627 /src/nvim/diff.c
parent90128843f68bc6b96cc7ab7a97d172aaae742aa4 (diff)
downloadrneovim-594536a1e71c90fd558501a675c459b8c7c242ea.tar.gz
rneovim-594536a1e71c90fd558501a675c459b8c7c242ea.tar.bz2
rneovim-594536a1e71c90fd558501a675c459b8c7c242ea.zip
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 vim/vim#2394) https://github.com/vim/vim/commit/97ce419201421f65f4764549ed80307a7ef9c7a6
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index e7a176d336..878971a35c 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -44,6 +44,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
@@ -1838,6 +1839,9 @@ int diffopt_changed(void)
} else if ((STRNCMP(p, "foldcolumn:", 11) == 0) && ascii_isdigit(p[11])) {
p += 11;
diff_foldcolumn_new = getdigits_int(&p);
+ } else if (STRNCMP(p, "hiddenoff", 9) == 0) {
+ p += 9;
+ diff_flags_new |= DIFF_HIDDEN_OFF;
}
if ((*p != ',') && (*p != NUL)) {
@@ -1880,6 +1884,12 @@ bool diffopt_horizontal(void)
return (diff_flags & DIFF_HORIZONTAL) != 0;
}
+// Return true if 'diffopt' contains "hiddenoff".
+bool diffopt_hiddenoff(void)
+{
+ return (diff_flags & DIFF_HIDDEN_OFF) != 0;
+}
+
/// Find the difference within a changed line.
///
/// @param wp window whose current buffer to check