mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-11 12:53:52 -05:00
Allow -/ and :/ to refer to current work tree file
This commit is contained in:
@@ -445,6 +445,8 @@ endfunction
|
|||||||
function! s:buffer_expand(rev) dict abort
|
function! s:buffer_expand(rev) dict abort
|
||||||
if a:rev =~# '^:[0-3]$'
|
if a:rev =~# '^:[0-3]$'
|
||||||
let file = a:rev.self.path(':')
|
let file = a:rev.self.path(':')
|
||||||
|
elseif a:rev =~# '^[-:]/$'
|
||||||
|
let file = '/'.self.path()
|
||||||
elseif a:rev =~# '^-'
|
elseif a:rev =~# '^-'
|
||||||
let file = 'HEAD^{}'.a:rev[1:-1].self.path(':')
|
let file = 'HEAD^{}'.a:rev[1:-1].self.path(':')
|
||||||
elseif a:rev =~# '^@{'
|
elseif a:rev =~# '^@{'
|
||||||
@@ -455,7 +457,7 @@ function! s:buffer_expand(rev) dict abort
|
|||||||
else
|
else
|
||||||
let file = a:rev
|
let file = a:rev
|
||||||
endif
|
endif
|
||||||
return s:sub(s:sub(file,'\%$',self.path()),'/$','')
|
return s:sub(s:sub(file,'\%$',self.path()),'\.\@<=/$','')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:buffer_containing_commit() dict abort
|
function! s:buffer_containing_commit() dict abort
|
||||||
|
|||||||
Reference in New Issue
Block a user