mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-10 04:13:48 -05:00
Make the behavior of window splits consistent (#1035)
* add option to spawn split from previous window * Update some comments and remove debugging statement. * Simplify the code, and make it respect NERDTreeWinPos and 'splitbelow'. * Better logic for getting NERDTree window number when not active window. * Use common functions for splitting windows. Make splitting respect user. The placement of split windows now respects the user's choices for the splitright and splitbelow settings, and the g:NERDTreeWinPos variable. * Update version number in change log.
This commit is contained in:
@@ -148,12 +148,19 @@ function! s:NERDTree.GetWinNum()
|
||||
return bufwinnr(t:NERDTreeBufName)
|
||||
endif
|
||||
|
||||
" If WindowTree, there is no t:NERDTreeBufName variable. Search all windows.
|
||||
for w in range(1,winnr('$'))
|
||||
if bufname(winbufnr(w)) =~# '^' . g:NERDTreeCreator.BufNamePrefix() . '\d\+$'
|
||||
return w
|
||||
endif
|
||||
endfor
|
||||
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:NERDTree.IsOpen() {{{1
|
||||
function! s:NERDTree.IsOpen()
|
||||
return s:NERDTree.GetWinNum() != -1 || bufname('%') =~# '^' . g:NERDTreeCreator.BufNamePrefix() . '\d\+$'
|
||||
return s:NERDTree.GetWinNum() != -1
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:NERDTree.isTabTree() {{{1
|
||||
|
||||
Reference in New Issue
Block a user