Skip to content
Browse files

update nredtree

  • Loading branch information...
1 parent 6599d34 commit af5032477efb8ba3570c72bff13eb5c0144ad18f @bleything committed Jul 23, 2011
Showing with 11 additions and 7 deletions.
  1. +7 −5 bundle/nerdtree/nerdtree_plugin/fs_menu.vim
  2. +4 −2 bundle/nerdtree/plugin/NERD_tree.vim
View
12 bundle/nerdtree/nerdtree_plugin/fs_menu.vim
@@ -57,7 +57,7 @@ function! NERDTreeAddNode()
let newNodeName = input("Add a childnode\n".
\ "==========================================================\n".
\ "Enter the dir/file name to be created. Dirs end with a '/'\n" .
- \ "", curDirNode.path.str() . g:NERDTreePath.Slash())
+ \ "", curDirNode.path.str() . g:NERDTreePath.Slash(), "file")
if newNodeName ==# ''
call s:echo("Node Creation Aborted.")
@@ -85,7 +85,7 @@ function! NERDTreeMoveNode()
let newNodePath = input("Rename the current node\n" .
\ "==========================================================\n" .
\ "Enter the new path for the node: \n" .
- \ "", curNode.path.str())
+ \ "", curNode.path.str(), "file")
if newNodePath ==# ''
call s:echo("Node Renaming Aborted.")
@@ -163,7 +163,7 @@ function! NERDTreeCopyNode()
let newNodePath = input("Copy the current node\n" .
\ "==========================================================\n" .
\ "Enter the new path to copy the node to: \n" .
- \ "", currentNode.path.str())
+ \ "", currentNode.path.str(), "file")
if newNodePath != ""
"strip trailing slash
@@ -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
View
6 bundle/nerdtree/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
@@ -991,7 +993,7 @@ function! s:TreeFileNode.getLineNum()
"the path components we have matched so far
let pathcomponents = [substitute(b:NERDTreeRoot.path.str({'format': 'UI'}), '/ *$', '', '')]
"the index of the component we are searching for
- let curPathComponent = 0
+ let curPathComponent = 1
let fullpath = self.path.str({'format': 'UI'})

0 comments on commit af50324

Please sign in to comment.
Something went wrong with that request. Please try again.