Strip backslashes on expansion

Closes https://github.com/tpope/vim-fugitive/issues/975
This commit is contained in:
Tim Pope
2017-11-30 15:00:35 -05:00
parent de6c05720c
commit 5032d9ee72

View File

@@ -661,7 +661,9 @@ function! s:buffer_expand(rev) dict abort
else
let file = a:rev
endif
return s:sub(s:sub(file,'\%$',self.path()),'\.\@<=/$','')
return s:sub(substitute(file,
\ '%$\|\\\([[:punct:]]\)','\=len(submatch(1)) ? submatch(1) : self.path()','g'),
\ '\.\@<=/$','')
endfunction
function! s:buffer_containing_commit() dict abort