mirror of
https://github.com/preservim/nerdtree.git
synced 2025-02-12 20:24:00 +08:00
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.
This commit is contained in:
parent
e6d2f12bf6
commit
87382097df
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user