Preserve alternate file in :Gmove

Second time's the charm.  I've decided moving is sufficiently different
from copying to justify this.
This commit is contained in:
Tim Pope 2012-03-13 20:58:59 -04:00
parent 168de6fbc5
commit 5b1467af75

View File

@ -1370,9 +1370,9 @@ function! s:Move(force,destination)
call fugitive#reload_status()
if s:buffer().commit() == ''
if isdirectory(destination)
return 'edit '.s:fnameescape(destination)
return 'keepalt edit '.s:fnameescape(destination)
else
return 'saveas! '.s:fnameescape(destination)
return 'keepalt saveas! '.s:fnameescape(destination)
endif
else
return 'file '.s:fnameescape(s:repo().translate(':0:'.destination)