From 0501fc825ce9c5dc1c80a0d4d9e75dd3546e27d4 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sat, 7 Jun 2008 17:40:18 +1200 Subject: [PATCH] add :MarkToRoot command and a corresponding function --- plugin/NERD_tree.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index d059835..def196f 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -2478,6 +2478,7 @@ function! s:BindMappings() command! -buffer -complete=customlist,s:FindMarks -nargs=1 RecallMark :call RecallMark('') command! -buffer -complete=customlist,s:FindMarks -nargs=1 OpenMark :call OpenMark('') command! -buffer -complete=customlist,s:FindMarks -nargs=+ ClearMarks call ClearMarks('') + command! -buffer -complete=customlist,s:FindMarks -nargs=+ MarkToRoot call MarkToRoot('') command! -buffer -nargs=0 ClearAllMarks let t:NERDTreeMarks = {} call RenderView() endfunction @@ -2832,6 +2833,13 @@ function! s:MarkNode(name) call s:Echo("select a node first") endif endfunction +" FUNCTION: s:MarkToRoot(name) {{{2 +" Make the node for the given mark the new tree root +function! s:MarkToRoot(name) + let targetNode = s:GetNodeForMark(a:name, 1) + call targetNode.MakeRoot() + call s:RenderView() +endfunction " FUNCTION: s:OpenEntrySplit() {{{2 " Opens the currently selected file from the explorer in a " new window