aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-24 12:19:25 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-24 12:38:02 -0400
commit6d932ccb1c03208c4f5cc94f65517184e3c6d12f (patch)
tree240ca39857521a69c2daf7050743e3e92731c79d /src/nvim/diff.c
parent0a653f7ab98dfc05bf0532b9f81bc19377031900 (diff)
downloadrneovim-6d932ccb1c03208c4f5cc94f65517184e3c6d12f.tar.gz
rneovim-6d932ccb1c03208c4f5cc94f65517184e3c6d12f.tar.bz2
rneovim-6d932ccb1c03208c4f5cc94f65517184e3c6d12f.zip
vim-patch:8.2.2880: unified diff fails if actually used
Problem: Unified diff fails if actually used. Solution: Invoke :diffupdate in the test. Fix the check for working external diff. (Ghjuvan Lacambre, Christian Brabandt, closes vim/vim#8197) https://github.com/vim/vim/commit/ad5c178a191cf2cf37a27c2a789d7afda3879831
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 31b7b1bd8f..5f8b81822b 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -982,12 +982,14 @@ static int check_external_diff(diffio_T *diffio)
char_u linebuf[LBUFLEN];
for (;;) {
- // There must be a line that contains "1c1".
+ // For normal diff there must be a line that contains
+ // "1c1". For unified diff "@@ -1 +1 @@".
if (vim_fgets(linebuf, LBUFLEN, fd)) {
break;
}
- if (STRNCMP(linebuf, "1c1", 3) == 0) {
+ if (STRNCMP(linebuf, "1c1", 3) == 0
+ || STRNCMP(linebuf, "@@ -1 +1 @@", 11) == 0) {
ok = kTrue;
}
}