From cf61ad328540e28a03b98ddb42c7ab466790008b Mon Sep 17 00:00:00 2001 From: marty Date: Tue, 15 Sep 2009 19:57:08 +1200 Subject: [PATCH] change the statusline so restoring a session doesnt break so badly --- plugin/NERD_tree.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 1b05cbd..1bd3b9d 100644 --- 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)