Skip to content

Commit

Permalink
Make :GRename ./ and ../ respect parent dir of current file
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Dec 29, 2024
1 parent fcb4db5 commit 174230d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions autoload/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6769,7 +6769,6 @@ function! s:Move(force, rename, destination) abort
if destination !~# '^/\|^\a\+:'
let destination = s:Tree(dir) . '/' . destination
endif
let destination = s:Tree(dir) .
elseif a:destination =~# '^:(\%(top,literal\|literal,top\))'
let destination = s:Tree(dir) . matchstr(a:destination, ')\zs.*')
elseif a:destination =~# '^:(literal)\.\.\=\%(/\|$\)'
Expand All @@ -6778,8 +6777,8 @@ function! s:Move(force, rename, destination) abort
let destination = simplify(default_root . matchstr(a:destination, ')\zs.*'))
else
let destination = s:Expand(a:destination)
if destination =~# '^\.\.\=\%(/\|$\)'
let destination = simplify(getcwd() . '/' . destination)
if destination =~# '^\.\.\=\%(/\|$\)' && !a:rename
let destination = simplify((a:rename ? default_root : getcwd() . '/') . destination)
elseif destination !~# '^\a\+:\|^/'
let destination = default_root . destination
endif
Expand Down

0 comments on commit 174230d

Please sign in to comment.