nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit cf61ad328540e28a03b98ddb42c7ab466790008b
parent f772cfdefb30f81ed5e82a81e0b6c0b97b7e09b3
Author: marty <martin_grenfell@msn.com>
Date:   Tue, 15 Sep 2009 19:57:08 +1200

change the statusline so restoring a session doesnt break so badly

Diffstat:
Mplugin/NERD_tree.vim | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -80,7 +80,12 @@ endif
 let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*')
 
 if !exists('g:NERDTreeStatusline')
-    let g:NERDTreeStatusline = "%{b:NERDTreeRoot.path.str()}"
+
+    "the exists() crap here is a hack to stop vim spazzing out when
+    "loading a session that was created with an open nerd tree. It spazzes
+    "because it doesnt store b:NERDTreeRoot (its a b: var, and its a hash)
+    let g:NERDTreeStatusline = "%{exists('b:NERDTreeRoot')?b:NERDTreeRoot.path.str():''}"
+
 endif
 call s:initVariable("g:NERDTreeWinPos", "left")
 call s:initVariable("g:NERDTreeWinSize", 31)