nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 6b7760e6e4298ba628263f4d0bc5b51a78201c61
parent 5cafc7018d3b72f30164d4c98547eb93db27b8f6
Author: Martin Grenfell <martin_grenfell@msn.com>
Date:   Sat,  7 Jun 2008 17:34:45 +1200

add s:AbsoluteTreeRoot()

Diffstat:
Mplugin/NERD_tree.vim | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -1320,7 +1320,15 @@ function! s:Abs(num)
         return 0 - a:num
     end
 endfunction
-
+"FUNCTION: s:AbsoluteTreeRoot(){{{2
+" returns the highest cached ancestor of the current root
+function! s:AbsoluteTreeRoot()
+    let currentNode = t:NERDTreeRoot
+    while currentNode.parent != {}
+        let currentNode = currentNode.parent
+    endwhile
+    return currentNode
+endfunction
 "FUNCTION: s:BufInWindows(bnum){{{2
 "[[STOLEN FROM VTREEEXPLORER.VIM]]
 "Determine the number of windows open to this buffer number.