continue breaking down the epic autoload module

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.
This commit is contained in:
Martin Grenfell
2014-07-07 22:59:28 +01:00
parent f982f61e8a
commit 23dfc6d818
11 changed files with 337 additions and 290 deletions

View File

@@ -117,7 +117,7 @@ function! NERDTreeAddNode()
let newTreeNode = g:NERDTreeFileNode.New(newPath)
if empty(parentNode)
call b:NERDTreeRoot.refresh()
call nerdtree#renderView()
call b:NERDTree.render()
elseif parentNode.isOpen || !empty(parentNode.children)
call parentNode.addChild(newTreeNode, 1)
call NERDTreeRender()
@@ -230,7 +230,7 @@ function! NERDTreeCopyNode()
let newNode = currentNode.copy(newNodePath)
if empty(newNode)
call b:NERDTreeRoot.refresh()
call nerdtree#renderView()
call b:NERDTree.render()
else
call NERDTreeRender()
call newNode.putCursorHere(0, 0)