fix a bug where doing a :cd would cause :NERDTreeToggle to fail
This commit is contained in:
parent
23e79de2c2
commit
5e50601788
@ -2353,18 +2353,20 @@ function! s:createTreeWin()
|
|||||||
"create the nerd tree window
|
"create the nerd tree window
|
||||||
let splitLocation = g:NERDTreeWinPos == "left" ? "topleft " : "botright "
|
let splitLocation = g:NERDTreeWinPos == "left" ? "topleft " : "botright "
|
||||||
let splitSize = g:NERDTreeWinSize
|
let splitSize = g:NERDTreeWinSize
|
||||||
|
silent! exec splitLocation . 'vertical ' . splitSize . ' new'
|
||||||
|
|
||||||
if !exists('t:NERDTreeBufName')
|
if !exists('t:NERDTreeBufName')
|
||||||
let t:NERDTreeBufName = s:nextBufferName()
|
let t:NERDTreeBufName = s:nextBufferName()
|
||||||
|
silent! exec "edit " . t:NERDTreeBufName
|
||||||
|
else
|
||||||
|
silent! exec "buffer " . t:NERDTreeBufName
|
||||||
endif
|
endif
|
||||||
let cmd = splitLocation . 'vertical ' . splitSize . ' new ' . t:NERDTreeBufName
|
|
||||||
silent! execute cmd
|
|
||||||
|
|
||||||
setlocal winfixwidth
|
setlocal winfixwidth
|
||||||
|
|
||||||
"throwaway buffer options
|
"throwaway buffer options
|
||||||
setlocal noswapfile
|
setlocal noswapfile
|
||||||
setlocal buftype=nofile
|
setlocal buftype=nofile
|
||||||
"setlocal bufhidden=delete
|
|
||||||
setlocal nowrap
|
setlocal nowrap
|
||||||
setlocal foldcolumn=0
|
setlocal foldcolumn=0
|
||||||
setlocal nobuflisted
|
setlocal nobuflisted
|
||||||
|
Loading…
x
Reference in New Issue
Block a user