fix for copying files

when copying a file outside the current tree root, {} is returned by
TreeFileNode.copy() so try to reposition the cursor
This commit is contained in:
Martin Grenfell 2011-07-09 18:44:03 +12:00
parent c08d7e9f19
commit 2dd198c6c4

View File

@ -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