mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 23:03:51 -05:00
Add FugitiveFilename() to determine corresponding real file
This commit is contained in:
@@ -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!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user