Navigation Menu

Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
update nredtree
Browse files Browse the repository at this point in the history
  • Loading branch information
bleything committed Jul 23, 2011
1 parent 6599d34 commit af50324
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
12 changes: 7 additions & 5 deletions bundle/nerdtree/nerdtree_plugin/fs_menu.vim
Expand Up @@ -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.")
Expand Down Expand Up @@ -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.")
Expand Down Expand Up @@ -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
Expand All @@ -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
6 changes: 4 additions & 2 deletions bundle/nerdtree/plugin/NERD_tree.vim
Expand Up @@ -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
Expand Down Expand Up @@ -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'})

Expand Down

0 comments on commit af50324

Please sign in to comment.