Prevent overwriting existing files/dirs on node move. (m-m)

This commit is contained in:
Phil Runninger 2020-01-15 19:51:39 -05:00
parent ee79ecfb67
commit 97e4b47aa3

View File

@ -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.')