nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 97e4b47aa3b6c6acb6621eedd7fcaa299c5dea88
parent ee79ecfb67e4403e54ea59c175ca4d39544395e8
Author: Phil Runninger <prunninger@vhtcx.com>
Date:   Wed, 15 Jan 2020 19:51:39 -0500

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

Diffstat:
Mnerdtree_plugin/fs_menu.vim | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/nerdtree_plugin/fs_menu.vim b/nerdtree_plugin/fs_menu.vim
@@ -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.')