mirror of
https://github.com/preservim/nerdtree.git
synced 2025-12-13 20:36:50 +01:00
Add 2 new classes and move code into them from autoload: * NERDTree. Each nerdtree buffer now has a NERDTree object that holds the root node and will old other util functions * UI. Each NERDTree object holds a UI object which is responsible for rendering, getting the current node, etc Still a fair few methods to sort through in autoload (many of which will end up in the above classes) - need sleep though.
24 lines
546 B
VimL
24 lines
546 B
VimL
"CLASS: NERDTree
|
|
"============================================================
|
|
let s:NERDTree = {}
|
|
let g:NERDTree = s:NERDTree
|
|
|
|
function! s:NERDTree.ForCurrentBuf()
|
|
return b:NERDTree
|
|
endfunction
|
|
|
|
function! s:NERDTree.New(path)
|
|
let newObj = copy(self)
|
|
let newObj.ui = g:NERDTreeUI.New(newObj)
|
|
let newObj.root = g:NERDTreeDirNode.New(a:path)
|
|
|
|
return newObj
|
|
endfunction
|
|
|
|
"FUNCTION: s:NERDTree.render() {{{1
|
|
"A convenience function - since this is called often
|
|
function! s:NERDTree.render()
|
|
call self.ui.render()
|
|
endfunction
|
|
|