mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-10 20:33:50 -05:00
add some class methods to wrap the NERDTreeCreator public methods
This is needed because some versions of vim dont let you chain method calls together. So do the work in NERDTreeCreator instead of forcing all callers to break the New().createXXX() calls out onto 2 lines with an intermediate variable. Fixes #226.
This commit is contained in:
@@ -149,11 +149,11 @@ runtime plugin/nerdtree/creator.vim
|
||||
" SECTION: Commands {{{1
|
||||
"============================================================
|
||||
"init the command that users start the nerd tree with
|
||||
command! -n=? -complete=dir -bar NERDTree :call g:NERDTreeCreator.New().createPrimary('<args>')
|
||||
command! -n=? -complete=dir -bar NERDTreeToggle :call g:NERDTreeCreator.New().togglePrimary('<args>')
|
||||
command! -n=? -complete=dir -bar NERDTree :call g:NERDTreeCreator.CreatePrimary('<args>')
|
||||
command! -n=? -complete=dir -bar NERDTreeToggle :call g:NERDTreeCreator.TogglePrimary('<args>')
|
||||
command! -n=0 -bar NERDTreeClose :call nerdtree#closeTreeIfOpen()
|
||||
command! -n=1 -complete=customlist,nerdtree#completeBookmarks -bar NERDTreeFromBookmark call g:NERDTreeCreator.New().createPrimary('<args>')
|
||||
command! -n=0 -bar NERDTreeMirror call g:NERDTreeCreator.New().createMirror()
|
||||
command! -n=1 -complete=customlist,nerdtree#completeBookmarks -bar NERDTreeFromBookmark call g:NERDTreeCreator.CreatePrimary('<args>')
|
||||
command! -n=0 -bar NERDTreeMirror call g:NERDTreeCreator.CreateMirror()
|
||||
command! -n=0 -bar NERDTreeFind call nerdtree#findAndRevealPath()
|
||||
command! -n=0 -bar NERDTreeFocus call NERDTreeFocus()
|
||||
command! -n=0 -bar NERDTreeCWD call NERDTreeCWD()
|
||||
@@ -201,7 +201,7 @@ function! NERDTreeFocus()
|
||||
if nerdtree#isTreeOpen()
|
||||
call nerdtree#putCursorInTreeWin()
|
||||
else
|
||||
call g:NERDTreeCreator.New().togglePrimary("")
|
||||
call g:NERDTreeCreator.TogglePrimary("")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user