commit 2dd198c6c412b4ddd361b43586b01981e8383239
parent c08d7e9f192716a9f30bbf45e50f6f7c252fc115
Author: Martin Grenfell <martin.grenfell@gmail.com>
Date: Sat, 9 Jul 2011 18:44:03 +1200
fix for copying files
when copying a file outside the current tree root, {} is returned by
TreeFileNode.copy() so try to reposition the cursor
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/nerdtree_plugin/fs_menu.vim b/nerdtree_plugin/fs_menu.vim
@@ -179,8 +179,10 @@ function! NERDTreeCopyNode()
if confirmed
try
let newNode = currentNode.copy(newNodePath)
- call NERDTreeRender()
- call newNode.putCursorHere(0, 0)
+ if !empty(newNode)
+ call NERDTreeRender()
+ call newNode.putCursorHere(0, 0)
+ endif
catch /^NERDTree/
call s:echoWarning("Could not copy node")
endtry