Add FugitiveFilename() to determine corresponding real file

This commit is contained in:
Tim Pope committed 2018-06-14 15:37:24 -04:00
1 parent b571bff9ec
commit cc9d8d93c8
2 files changed
+36

No files matched your search

+9
View File
@@ -138,6 +138,15 @@ function! FugitiveHead(...) abort
return fugitive#repo().head(a:0 ? a:1 : 0)
endfunction
function! FugitiveFilename(...) abort
let file = fnamemodify(a:0 ? a:1 : @%, ':p')
if file =~? '^fugitive:'
return fugitive#Filename(file)
else
return file
endif
endfunction
augroup fugitive
autocmd!