mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-22 11:32:25 +08:00
Prevent overwriting existing files/dirs on node move. (m-m)
This commit is contained in:
parent
ee79ecfb67
commit
97e4b47aa3
|
@ -196,6 +196,11 @@ function! NERDTreeMoveNode()
|
|||
let curNode = g:NERDTreeFileNode.GetSelected()
|
||||
let prompt = s:inputPrompt('move')
|
||||
let newNodePath = input(prompt, curNode.path.str(), 'file')
|
||||
while filereadable(newNodePath)
|
||||
call nerdtree#echoWarning('This destination already exists. Try again.')
|
||||
let newNodePath = input(prompt, curNode.path.str(), 'file')
|
||||
endwhile
|
||||
|
||||
|
||||
if newNodePath ==# ''
|
||||
call nerdtree#echo('Node Renaming Aborted.')
|
||||
|
|
Loading…
Reference in New Issue
Block a user