Better handling of :/pattern style revisions
This commit is contained in:
parent
7da464557b
commit
db535978f1
@ -524,7 +524,11 @@ function! s:Edit(cmd,...) abort
|
|||||||
else
|
else
|
||||||
let file = s:buffer().path('/')
|
let file = s:buffer().path('/')
|
||||||
endif
|
endif
|
||||||
let file = s:repo().translate(file)
|
try
|
||||||
|
let file = s:repo().translate(file)
|
||||||
|
catch /^fugitive:/
|
||||||
|
return 'echoerr v:errmsg'
|
||||||
|
endtry
|
||||||
if a:cmd =~# 'read!$'
|
if a:cmd =~# 'read!$'
|
||||||
return '%delete|read '.s:fnameescape(file).'|1delete_|diffupdate|'.line('.')
|
return '%delete|read '.s:fnameescape(file).'|1delete_|diffupdate|'.line('.')
|
||||||
else
|
else
|
||||||
@ -673,6 +677,12 @@ function! s:Diff(...) abort
|
|||||||
let file = s:buffer().path('/')
|
let file = s:buffer().path('/')
|
||||||
elseif a:1 ==# ':'
|
elseif a:1 ==# ':'
|
||||||
let file = s:buffer().path(':0:')
|
let file = s:buffer().path(':0:')
|
||||||
|
elseif a:1 =~# '^:/'
|
||||||
|
try
|
||||||
|
let file = s:repo().rev_parse(a:1)
|
||||||
|
catch /^fugitive:/
|
||||||
|
return 'echoerr v:errmsg'
|
||||||
|
endtry
|
||||||
else
|
else
|
||||||
let file = s:buffer().expand(a:1)
|
let file = s:buffer().expand(a:1)
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user