mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05: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:
@@ -5,6 +5,7 @@
|
|||||||
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
||||||
-->
|
-->
|
||||||
#### 6.9
|
#### 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)
|
- **.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)
|
- **.0**: Enable opening bookmarks in split windows. (PhilRunninger) [#1144](https://github.com/preservim/nerdtree/pull/1144)
|
||||||
#### 6.8
|
#### 6.8
|
||||||
|
|||||||
@@ -368,7 +368,7 @@ function! s:UI.saveScreenState()
|
|||||||
call g:NERDTree.CursorToTreeWin()
|
call g:NERDTree.CursorToTreeWin()
|
||||||
let self._screenState['oldPos'] = getpos('.')
|
let self._screenState['oldPos'] = getpos('.')
|
||||||
let self._screenState['oldTopLine'] = line('w0')
|
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)
|
call nerdtree#exec(win . 'wincmd w', 1)
|
||||||
catch
|
catch
|
||||||
endtry
|
endtry
|
||||||
|
|||||||
Reference in New Issue
Block a user