Skip to content

Commit 3b0b17d

Browse files
fix: Support GNU diff 3.11+
Starting from diff 3.11 filenames for `diff -r --brief` are wrapped with apostrophes, so regex to take filenames doesn't match.
1 parent 84bc899 commit 3b0b17d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

plugin/dirdiff.vim

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,11 @@ function! <SID>GetFileNameFromLine(AB, line)
784784
elseif <SID>IsDiffer(a:line)
785785
let regex = '^.*' . s:DirDiffDifferLine . '\[A\]\(.*\)' . s:DirDiffDifferAndLine . '\[B\]\(.*\)' . s:DirDiffDifferEndLine . '.*$'
786786
let fileToProcess = substitute(a:line, regex, '\1', '')
787+
if fileToProcess == a:line
788+
" Didn't match, try filename in apostrophes
789+
let regex = '^.*' . s:DirDiffDifferLine . "'\\[A\\]\\(.*\\)'" . s:DirDiffDifferAndLine . "'\\[B\\]\\(.*\\)'" . s:DirDiffDifferEndLine . '.*$'
790+
let fileToProcess = substitute(a:line, regex, '\1', '')
791+
endif
787792
else
788793
endif
789794

0 commit comments

Comments
 (0)