From 5bd641834d13c98352811fc4dad1cbafbb252afc Mon Sep 17 00:00:00 2001 From: Andrew Radev Date: Fri, 8 Jul 2011 22:10:13 +0300 Subject: [PATCH] Fix for copying error When copying a node to a directory that's outside the current path, the "parent" node doesn't really exist, so the code raised an error. --- plugin/NERD_tree.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index b5d014b..738ab9e 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -866,8 +866,10 @@ function! s:TreeFileNode.copy(dest) let parent = b:NERDTreeRoot.findNode(newPath.getParent()) if !empty(parent) call parent.refresh() + return parent.findNode(newPath) + else + return {} endif - return parent.findNode(newPath) endfunction "FUNCTION: TreeFileNode.delete {{{3