make fugitive commands available in nerdtree bufs
Previously s:Detect() wasnt getting called for nerdtree buffers. I have added two autocmd events to nerdtree - NERDTreeInit and NERDTreeNewRoot. These are called when a tree is created, and when the user changes the root. Catch these events and call s:Detect() with the tree root path.
This commit is contained in:
parent
51de95ddee
commit
89e771ea96
@ -162,6 +162,7 @@ augroup fugitive
|
|||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufNewFile,BufReadPost * call s:Detect(expand('<amatch>:p'))
|
autocmd BufNewFile,BufReadPost * call s:Detect(expand('<amatch>:p'))
|
||||||
autocmd FileType netrw call s:Detect(expand('<afile>:p'))
|
autocmd FileType netrw call s:Detect(expand('<afile>:p'))
|
||||||
|
autocmd User NERDTreeInit,NERDTreeNewRoot call s:Detect(b:NERDTreeRoot.path.str())
|
||||||
autocmd VimEnter * if expand('<amatch>')==''|call s:Detect(getcwd())|endif
|
autocmd VimEnter * if expand('<amatch>')==''|call s:Detect(getcwd())|endif
|
||||||
autocmd BufWinLeave * execute getwinvar(+bufwinnr(+expand('<abuf>')), 'fugitive_leave')
|
autocmd BufWinLeave * execute getwinvar(+bufwinnr(+expand('<abuf>')), 'fugitive_leave')
|
||||||
augroup END
|
augroup END
|
||||||
|
Loading…
Reference in New Issue
Block a user