Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ":clearjumps" in new NERDTree windows #844

Merged
merged 1 commit into from
May 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions lib/nerdtree/creator.vim
Original file line number Diff line number Diff line change
Expand Up @@ -178,24 +178,28 @@ function! s:Creator.createMirror()
endfunction

" FUNCTION: s:Creator._createTreeWin() {{{1
" Inits the NERD tree window. ie. opens it, sizes it, sets all the local
" options etc
" Initialize the NERDTree window. Open the window, size it properly, set all
" local options, etc.
function! s:Creator._createTreeWin()
"create the nerd tree window
let splitLocation = g:NERDTreeWinPos ==# "left" ? "topleft " : "botright "
let splitSize = g:NERDTreeWinSize
let l:splitLocation = g:NERDTreeWinPos ==# 'left' ? 'topleft ' : 'botright '
let l:splitSize = g:NERDTreeWinSize

if !g:NERDTree.ExistsForTab()
let t:NERDTreeBufName = self._nextBufferName()
silent! exec splitLocation . 'vertical ' . splitSize . ' new'
silent! exec "edit " . t:NERDTreeBufName
silent! execute l:splitLocation . 'vertical ' . l:splitSize . ' new'
silent! execute 'edit ' . t:NERDTreeBufName
else
silent! exec splitLocation . 'vertical ' . splitSize . ' split'
silent! exec "buffer " . t:NERDTreeBufName
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
Expand Down