From 87382097dfcd1357467b8ccb2d14bc86b08cd950 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Tue, 24 Jun 2008 19:32:52 +1200 Subject: [PATCH] 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. --- plugin/NERD_tree.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 39970d3..565f9a4 100644 --- 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