mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 11:53:48 -05:00
move TreeFileNode.makeRoot() to NERDTree.changeRoot(node)
This commit is contained in:
@@ -218,26 +218,6 @@ function! s:TreeFileNode.isRoot()
|
||||
return self.equals(b:NERDTree.root)
|
||||
endfunction
|
||||
|
||||
"FUNCTION: TreeFileNode.makeRoot() {{{1
|
||||
"Make this node the root of the tree
|
||||
function! s:TreeFileNode.makeRoot()
|
||||
if self.path.isDirectory
|
||||
let b:NERDTree.root = self
|
||||
else
|
||||
call self.cacheParent()
|
||||
let b:NERDTree.root = self.parent
|
||||
endif
|
||||
|
||||
call b:NERDTree.root.open()
|
||||
|
||||
"change dir to the dir of the new root if instructed to
|
||||
if g:NERDTreeChDirMode ==# 2
|
||||
exec "cd " . b:NERDTree.root.path.str({'format': 'Edit'})
|
||||
endif
|
||||
|
||||
silent doautocmd User NERDTreeNewRoot
|
||||
endfunction
|
||||
|
||||
"FUNCTION: TreeFileNode.New(path) {{{1
|
||||
"Returns a new TreeNode object with the given path and parent
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user