mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Retire :Gedit -..., :Gedit @{...}, and :Gedit :n
I'm introducing :Gedit >... as a new shorthand because a leading > is handled by fnameescape(), but it's very ugly, I don't think I want to make it official.
This commit is contained in:
@@ -858,13 +858,15 @@ endfunction
|
||||
|
||||
function! s:Expand(rev) abort
|
||||
if a:rev =~# '^:[0-3]$'
|
||||
let file = a:rev . s:Relative(':')
|
||||
elseif a:rev =~# '^-'
|
||||
let file = 'HEAD^{}' . a:rev[1:-1] . s:Relative(':')
|
||||
elseif a:rev =~# '^@{'
|
||||
let file = 'HEAD' . a:rev. s:Relative(':')
|
||||
elseif a:rev =~# '^\^[0-9~^{]\|^\~[0-9~^]\|^\^$'
|
||||
call s:throw('Use ' . string(a:rev . ':%') . ' instead of ' . string(a:rev))
|
||||
elseif a:rev =~# '^@{' || a:rev =~# '^\^[0-9~^{]\|^\~[0-9~^]\|^\^$'
|
||||
call s:throw('Use ' . string('!' . a:rev . ':%') . ' instead of ' . string(a:rev))
|
||||
elseif a:rev =~# '^-'
|
||||
call s:throw('Use ' . string('!' . a:rev[1:-1] . ':%') . ' instead of ' . string(a:rev))
|
||||
elseif a:rev =~# '^>[~^]\|^>@{\|^>:\d$'
|
||||
let file = 'HEAD' . a:rev[1:-1] . s:Relative(':')
|
||||
elseif a:rev =~# '^>[^> ]'
|
||||
let file = a:rev[1:-1] . s:Relative(':')
|
||||
else
|
||||
let file = a:rev
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user