mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Fix NERDTree opening with the wrong size. (#1008)
* Fix NERDTree opening with the wrong size. There were two commands that seemed to be causing the NERDTree window to open in exactly half the screen width. They are: - silent! execute 'edit ' . t:NERDTreeBufName in _createTreeWin() - setlocal nobuflisted in _setCommonBufOptions() These commands were reseting the width of NERDTree. The solution I chose was to resize the window after creating the new window, and then to set winfixwidth before setting the other common buffer options. * Update change log and version number.
This commit is contained in:
@@ -189,18 +189,20 @@ function! s:Creator._createTreeWin()
|
||||
let t:NERDTreeBufName = self._nextBufferName()
|
||||
silent! execute l:splitLocation . 'vertical ' . l:splitSize . ' new'
|
||||
silent! execute 'edit ' . t:NERDTreeBufName
|
||||
silent! execute 'vertical resize '. l:splitSize
|
||||
else
|
||||
silent! execute l:splitLocation . 'vertical ' . l:splitSize . ' split'
|
||||
silent! execute 'buffer ' . t:NERDTreeBufName
|
||||
endif
|
||||
|
||||
setlocal winfixwidth
|
||||
|
||||
call self._setCommonBufOptions()
|
||||
|
||||
if has('patch-7.4.1925')
|
||||
clearjumps
|
||||
endif
|
||||
|
||||
setlocal winfixwidth
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:Creator._isBufHidden(nr) {{{1
|
||||
|
||||
Reference in New Issue
Block a user