commit d102dd92fd9afeb23806ee92c3ab5b64d71fac2e (tree)
parent 9acced14092feea26d12df7758305a428ad35c88
Author: Tim Pope <code@tpope.net>
Date: Mon, 2 Mar 2020 02:37:44 -0500
Fix :GRename ../
Closes https://github.com/tpope/vim-fugitive/issues/1481
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -4986,9 +4986,7 @@ function! s:Move(force, rename, destination) abort
if s:DirCommitFile(@%)[1] !~# '^0\=$' || empty(@%)
return 'echoerr ' . string('fugitive: mv not supported for this buffer')
endif
- if a:destination =~# '^\.\.\=\%(/\|$\)'
- let destination = simplify(getcwd() . '/' . a:destination)
- elseif a:destination =~# '^\a\+:\|^/'
+ if a:destination =~# '^\a\+:\|^/'
let destination = a:destination
elseif a:destination =~# '^:/:\='
let destination = s:Tree(dir) . substitute(a:destination, '^:/:\=', '', '')
@@ -4997,7 +4995,9 @@ function! s:Move(force, rename, destination) abort
elseif a:destination =~# '^:(literal)'
let destination = simplify(getcwd() . '/' . matchstr(a:destination, ')\zs.*'))
elseif a:rename
- let destination = expand('%:p:s?[\/]$??:h') . '/' . a:destination
+ let destination = simplify(expand('%:p:s?[\/]$??:h') . '/' . a:destination)
+ elseif a:destination =~# '^\.\.\=\%(/\|$\)'
+ let destination = simplify(getcwd() . '/' . a:destination)
else
let destination = s:Tree(dir) . '/' . a:destination
endif