nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 87382097dfcd1357467b8ccb2d14bc86b08cd950
parent e6d2f12bf68a55f68ec9d99d467042fc799f677d
Author: Martin Grenfell <martin_grenfell@msn.com>
Date:   Tue, 24 Jun 2008 19:32:52 +1200

resize the tree window when it was the only one

if the nerd tree window is the only window open when the user opens a
file, the file will be opened in a new split. Previously that meant the
two windows would take up half the screen each.

Diffstat:
Mplugin/NERD_tree.vim | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -2207,6 +2207,14 @@ function! s:OpenNodeSplit(treenode)
         "do nothing
     endtry
 
+    "resize the tree window if no other window was open before
+    if onlyOneWin
+        let size = exists("t:NERDTreeOldWindowSize") ? t:NERDTreeOldWindowSize : g:NERDTreeWinSize
+        exec(there)
+        exec("silent ". splitMode ." resize ". size)
+        wincmd p
+    endif
+
     " Restore splitmode settings
     let &splitbelow=savesplitbelow
     let &splitright=savesplitright