mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-22 15:18:23 +08:00
put cursor on new node after copying
This commit is contained in:
parent
b747086137
commit
a520080cc3
|
@ -169,10 +169,11 @@ endfunction
|
|||
function! s:oTreeFileNode.Copy(dest) dict
|
||||
call self.path.Copy(a:dest)
|
||||
let newPath = s:oPath.New(a:dest)
|
||||
let parentNode = t:NERDTreeRoot.FindNode(newPath.GetParent())
|
||||
if !empty(parentNode)
|
||||
call parentNode.Refresh()
|
||||
let parent = t:NERDTreeRoot.FindNode(newPath.GetParent())
|
||||
if !empty(parent)
|
||||
call parent.Refresh()
|
||||
endif
|
||||
return parent.FindNode(newPath)
|
||||
endfunction
|
||||
|
||||
"FUNCTION: oTreeFileNode.Delete {{{3
|
||||
|
@ -2507,12 +2508,13 @@ function! s:CopyNode()
|
|||
|
||||
if confirmed
|
||||
try
|
||||
call currentNode.Copy(newNodePath)
|
||||
let newNode = currentNode.Copy(newNodePath)
|
||||
call s:RenderView()
|
||||
call s:PutCursorOnNode(newNode, 0)
|
||||
catch /^NERDTree/
|
||||
call s:EchoWarning("Could not copy node")
|
||||
endtry
|
||||
endif
|
||||
call s:RenderView()
|
||||
else
|
||||
call s:Echo("Copy aborted.")
|
||||
endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user