* Fix "R doesn't work when doing 'vim <folder>'" a different way. Instead of assigning a value to t:NERDTreeBufName for a window tree, which is used to determine if NERDTree is open, simply also look at the current buffer's name to see if it matches the NERDTree pattern. * Replace hardcoded buffer name prefix with BufNamePrefix() function.
This commit is contained in:
parent
28eb47e267
commit
70dc34cb69
@ -96,8 +96,7 @@ function! s:Creator.createWindowTree(dir)
|
|||||||
|
|
||||||
"we need a unique name for each window tree buffer to ensure they are
|
"we need a unique name for each window tree buffer to ensure they are
|
||||||
"all independent
|
"all independent
|
||||||
let t:NERDTreeBufName = self._nextBufferName()
|
exec g:NERDTreeCreatePrefix . " edit " . self._nextBufferName()
|
||||||
exec g:NERDTreeCreatePrefix . " edit " . t:NERDTreeBufName
|
|
||||||
|
|
||||||
call self._createNERDTree(path, "window")
|
call self._createNERDTree(path, "window")
|
||||||
let b:NERDTree._previousBuf = bufnr(previousBuf)
|
let b:NERDTree._previousBuf = bufnr(previousBuf)
|
||||||
|
@ -153,7 +153,7 @@ endfunction
|
|||||||
|
|
||||||
"FUNCTION: s:NERDTree.IsOpen() {{{1
|
"FUNCTION: s:NERDTree.IsOpen() {{{1
|
||||||
function! s:NERDTree.IsOpen()
|
function! s:NERDTree.IsOpen()
|
||||||
return s:NERDTree.GetWinNum() != -1
|
return s:NERDTree.GetWinNum() != -1 || bufname('%') =~# '^' . g:NERDTreeCreator.BufNamePrefix() . '\d\+$'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: s:NERDTree.isTabTree() {{{1
|
"FUNCTION: s:NERDTree.isTabTree() {{{1
|
||||||
|
Loading…
Reference in New Issue
Block a user