commit 35724ee2064d73061e67fc9f2f4342a62249f39b parent 719d6785d48ca33ba1352febf27fa0ba5caec063 Author: Jason Franklin <j_fra@fastmail.us> Date: Sat, 29 Jul 2017 08:55:28 -0400 Refactor the internals of "_newVSplit()" The previous change to this function was simple. I figured that it would be a good time to improve the style of this function with some minor edits. The function is now cleaner and more readable. Diffstat:
| M | lib/nerdtree/opener.vim | | | 18 | ++++++++++-------- |
1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/nerdtree/opener.vim b/lib/nerdtree/opener.vim @@ -222,20 +222,22 @@ endfunction " FUNCTION: Opener._newVSplit() {{{1 function! s:Opener._newVSplit() - let winwidth = winwidth(".") - if winnr("$")==#1 - let winwidth = g:NERDTreeWinSize + let l:winwidth = winwidth('.') + + if winnr('$') == 1 + let l:winwidth = g:NERDTreeWinSize endif - call nerdtree#exec("wincmd p") + call nerdtree#exec('wincmd p') vnew - let currentWin = winnr() + let l:currentWindowNumber = winnr() - "resize the nerd tree back to the original size + " Restore the NERDTree to its original width. call g:NERDTree.CursorToTreeWin() - exec("silent vertical resize ". winwidth) - exe currentWin . "wincmd w" + execute 'silent vertical resize ' . l:winwidth + + call nerdtree#exec(l:currentWindowNumber . 'wincmd w') endfunction " FUNCTION: Opener.open(target) {{{1
