mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-22 09:30:14 +08:00
Fix new NERDTrees' width when previous one was in the only window. (#1153)
* Fix new NERDTrees' width when previous one was in the only window. When leaving a NERDTree buffer, its window's width is remembered so that that width can be used when showing the buffer again in a new window. If NERDTree is the only window when leaving the buffer, it remembers the whole width of the editor. When a new NERDTree window is created, it is sized such that there is only a very small window for files to be opened into. To fix this, if NERDTree is the ONLY window, remember its width as the value of g:NERDTreeWinSize, not the width of the editor. * Update version number in change log.
This commit is contained in:
parent
aa37cb40da
commit
f8aa749985
|
@ -5,6 +5,7 @@
|
|||
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
||||
-->
|
||||
#### 6.9
|
||||
- **.3**: Fix new NERDTrees' width when previous one was in the only window. (PhilRunninger) [#1153](https://github.com/preservim/nerdtree/pull/1153)
|
||||
- **.2**: Fix the scope of several key mappings (lifecrisis, PhilRunninger) [#1151](https://github.com/preservim/nerdtree/pull/1151)
|
||||
- **.0**: Enable opening bookmarks in split windows. (PhilRunninger) [#1144](https://github.com/preservim/nerdtree/pull/1144)
|
||||
#### 6.8
|
||||
|
|
|
@ -368,7 +368,7 @@ function! s:UI.saveScreenState()
|
|||
call g:NERDTree.CursorToTreeWin()
|
||||
let self._screenState['oldPos'] = getpos('.')
|
||||
let self._screenState['oldTopLine'] = line('w0')
|
||||
let self._screenState['oldWindowSize']= winwidth('')
|
||||
let self._screenState['oldWindowSize'] = winnr('$')==1 ? g:NERDTreeWinSize : winwidth('')
|
||||
call nerdtree#exec(win . 'wincmd w', 1)
|
||||
catch
|
||||
endtry
|
||||
|
|
Loading…
Reference in New Issue
Block a user