mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-10 12:33:46 -05:00
Fix :GRename ../
Closes https://github.com/tpope/vim-fugitive/issues/1481
This commit is contained in:
@@ -4986,9 +4986,7 @@ function! s:Move(force, rename, destination) abort
|
|||||||
if s:DirCommitFile(@%)[1] !~# '^0\=$' || empty(@%)
|
if s:DirCommitFile(@%)[1] !~# '^0\=$' || empty(@%)
|
||||||
return 'echoerr ' . string('fugitive: mv not supported for this buffer')
|
return 'echoerr ' . string('fugitive: mv not supported for this buffer')
|
||||||
endif
|
endif
|
||||||
if a:destination =~# '^\.\.\=\%(/\|$\)'
|
if a:destination =~# '^\a\+:\|^/'
|
||||||
let destination = simplify(getcwd() . '/' . a:destination)
|
|
||||||
elseif a:destination =~# '^\a\+:\|^/'
|
|
||||||
let destination = a:destination
|
let destination = a:destination
|
||||||
elseif a:destination =~# '^:/:\='
|
elseif a:destination =~# '^:/:\='
|
||||||
let destination = s:Tree(dir) . substitute(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)'
|
elseif a:destination =~# '^:(literal)'
|
||||||
let destination = simplify(getcwd() . '/' . matchstr(a:destination, ')\zs.*'))
|
let destination = simplify(getcwd() . '/' . matchstr(a:destination, ')\zs.*'))
|
||||||
elseif a:rename
|
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
|
else
|
||||||
let destination = s:Tree(dir) . '/' . a:destination
|
let destination = s:Tree(dir) . '/' . a:destination
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user