mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Fix interpretation of :% when % is absolute
We're trying to support two different Git syntaxes here that were never meant to be mixed. We want :/foo/bar to be interpreted as the pathspec :(top)foo/bar, but we want :% to be interpreted as the % file in the index, even when % is /foo/bar. Resolves: https://github.com/tpope/vim-fugitive/issues/2404
This commit is contained in:
@@ -2071,6 +2071,8 @@ function! s:Expand(rev, ...) abort
|
|||||||
endif
|
endif
|
||||||
elseif s:Slash(a:rev) =~# '^\a\a\+://'
|
elseif s:Slash(a:rev) =~# '^\a\a\+://'
|
||||||
let file = substitute(a:rev, '\\\@<!\%(#\a\|%\x\x\)', '\\&', 'g')
|
let file = substitute(a:rev, '\\\@<!\%(#\a\|%\x\x\)', '\\&', 'g')
|
||||||
|
elseif a:rev =~# '^:[!#%$]'
|
||||||
|
let file = ':0' . a:rev
|
||||||
else
|
else
|
||||||
let file = a:rev
|
let file = a:rev
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user