mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 10:18:18 +00:00
vim-patch:8.1.0375: cannot use diff mode with Cygwin diff.exe
Problem: Cannot use diff mode with Cygwin diff.exe. (Igor Forca)
Solution: Skip over unrecognized lines in the diff output.
3b8defd0a5
This commit is contained in:
@@ -1511,6 +1511,10 @@ static void diff_read(int idx_orig, int idx_new, diffout_T *dout)
|
|||||||
&& (vim_fgets(linebuf, LBUFLEN, fd) == 0)
|
&& (vim_fgets(linebuf, LBUFLEN, fd) == 0)
|
||||||
&& (STRNCMP(line, "@@ ", 3) == 0)) {
|
&& (STRNCMP(line, "@@ ", 3) == 0)) {
|
||||||
diffstyle = DIFF_UNIFIED;
|
diffstyle = DIFF_UNIFIED;
|
||||||
|
} else {
|
||||||
|
// Format not recognized yet, skip over this line. Cygwin diff
|
||||||
|
// may put a warning at the start of the file.
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -517,7 +517,9 @@ func Test_diffexpr()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
func DiffExpr()
|
func DiffExpr()
|
||||||
silent exe '!diff ' . v:fname_in . ' ' . v:fname_new . '>' . v:fname_out
|
" Prepend some text to check diff type detection
|
||||||
|
call writefile(['warning', ' message'], v:fname_out)
|
||||||
|
silent exe '!diff ' . v:fname_in . ' ' . v:fname_new . '>>' . v:fname_out
|
||||||
endfunc
|
endfunc
|
||||||
set diffexpr=DiffExpr()
|
set diffexpr=DiffExpr()
|
||||||
set diffopt=foldcolumn:0
|
set diffopt=foldcolumn:0
|
||||||
|
Reference in New Issue
Block a user