Add >/ and >:/ as work-tree version expansions

Not sure I want to waste the easy to type ">" on the work tree version,
so adding some alternatives.
This commit is contained in:
Tim Pope
2021-09-03 11:12:34 -04:00
parent 2a53d79248
commit d488a7090f

View File

@@ -1868,7 +1868,7 @@ endfunction
function! s:Expand(rev, ...) abort function! s:Expand(rev, ...) abort
if a:rev =~# '^>\=:[0-3]$' if a:rev =~# '^>\=:[0-3]$'
let file = len(expand('%')) ? a:rev[-2:-1] . ':%' : '%' let file = len(expand('%')) ? a:rev[-2:-1] . ':%' : '%'
elseif a:rev ==# '>' elseif a:rev =~# '^>\%(:\=/\)\=$'
let file = '%' let file = '%'
elseif a:rev ==# '>:' elseif a:rev ==# '>:'
let file = empty(s:DirCommitFile(@%)[0]) ? ':0:%' : '%' let file = empty(s:DirCommitFile(@%)[0]) ? ':0:%' : '%'