diff options
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r-- | src/nvim/diff.c | 6 |
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; } } |