Skip to content

Commit

Permalink
fix for copying files
Browse files Browse the repository at this point in the history
when copying a file outside the current tree root, {} is returned by
TreeFileNode.copy() so try to reposition the cursor
  • Loading branch information
scrooloose committed Jul 9, 2011
1 parent c08d7e9 commit 2dd198c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nerdtree_plugin/fs_menu.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2dd198c

Please sign in to comment.