From 192b07ce1fb9a7a273232639cd2514f41e8a79af Mon Sep 17 00:00:00 2001 From: "Phil Runninger (mac)" Date: Tue, 7 Aug 2018 09:00:39 -0400 Subject: [PATCH 1/2] If the NERDTree is zoomed when 'o'pening a file, unzoom it. 'go' does not trigger this new behavior, because focus remains in the NERDTree. --- lib/nerdtree/opener.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/nerdtree/opener.vim b/lib/nerdtree/opener.vim index 974d99d..9de36d6 100644 --- a/lib/nerdtree/opener.vim +++ b/lib/nerdtree/opener.vim @@ -244,6 +244,9 @@ endfunction " FUNCTION: Opener._openFile() {{{1 function! s:Opener._openFile() + if !self._stay && exists("b:NERDTreeZoomed") && b:NERDTreeZoomed + call b:NERDTree.ui.toggleZoom() + endif if self._reuseWindow() return From b6978ecd7091c5a9f32176e4b020c83acc61b648 Mon Sep 17 00:00:00 2001 From: "Phil Runninger (mac)" Date: Tue, 7 Aug 2018 10:01:09 -0400 Subject: [PATCH 2/2] Unzoom only when user want NERDTree to stay open. --- lib/nerdtree/opener.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nerdtree/opener.vim b/lib/nerdtree/opener.vim index 9de36d6..1ea6e22 100644 --- a/lib/nerdtree/opener.vim +++ b/lib/nerdtree/opener.vim @@ -244,7 +244,7 @@ endfunction " FUNCTION: Opener._openFile() {{{1 function! s:Opener._openFile() - if !self._stay && exists("b:NERDTreeZoomed") && b:NERDTreeZoomed + if !self._stay && !g:NERDTreeQuitOnOpen && exists("b:NERDTreeZoomed") && b:NERDTreeZoomed call b:NERDTree.ui.toggleZoom() endif