mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 11:53:48 -05:00
reposition a method in the file
This commit is contained in:
@@ -1716,6 +1716,18 @@ endfunction
|
|||||||
|
|
||||||
" SECTION: View Functions {{{1
|
" SECTION: View Functions {{{1
|
||||||
"============================================================
|
"============================================================
|
||||||
|
" FUNCTION: s:BookmarkToRoot(name) {{{2
|
||||||
|
" Make the node for the given bookmark the new tree root
|
||||||
|
function! s:BookmarkToRoot(name)
|
||||||
|
try
|
||||||
|
let targetNode = s:oBookmark.GetNodeForName(a:name, 1)
|
||||||
|
catch /NERDTree.BookmarkNotFound/
|
||||||
|
let targetNode = s:oTreeFileNode.New(s:oBookmark.BookmarkFor(a:name).path)
|
||||||
|
endtry
|
||||||
|
call targetNode.MakeRoot()
|
||||||
|
call s:RenderView()
|
||||||
|
call s:PutCursorOnNode(targetNode, 0, 0)
|
||||||
|
endfunction
|
||||||
"FUNCTION: s:CenterView() {{{2
|
"FUNCTION: s:CenterView() {{{2
|
||||||
"centers the nerd tree window around the cursor (provided the nerd tree
|
"centers the nerd tree window around the cursor (provided the nerd tree
|
||||||
"options permit)
|
"options permit)
|
||||||
@@ -2855,18 +2867,6 @@ function! s:BookmarkNode(name)
|
|||||||
call s:Echo("select a node first")
|
call s:Echo("select a node first")
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
" FUNCTION: s:BookmarkToRoot(name) {{{2
|
|
||||||
" Make the node for the given bookmark the new tree root
|
|
||||||
function! s:BookmarkToRoot(name)
|
|
||||||
try
|
|
||||||
let targetNode = s:oBookmark.GetNodeForName(a:name, 1)
|
|
||||||
catch /NERDTree.BookmarkNotFound/
|
|
||||||
let targetNode = s:oTreeFileNode.New(s:oBookmark.BookmarkFor(a:name).path)
|
|
||||||
endtry
|
|
||||||
call targetNode.MakeRoot()
|
|
||||||
call s:RenderView()
|
|
||||||
call s:PutCursorOnNode(targetNode, 0, 0)
|
|
||||||
endfunction
|
|
||||||
"FUNCTION: s:CheckForActivate() {{{2
|
"FUNCTION: s:CheckForActivate() {{{2
|
||||||
"Checks if the click should open the current node, if so then activate() is
|
"Checks if the click should open the current node, if so then activate() is
|
||||||
"called (directories are automatically opened if the symbol beside them is
|
"called (directories are automatically opened if the symbol beside them is
|
||||||
|
|||||||
Reference in New Issue
Block a user