make the q mapping work with secondary trees

This commit is contained in:
Martin Grenfell 2009-01-09 14:46:49 +13:00
parent f06d99f7b5
commit 2f4d1b93e8
2 changed files with 11 additions and 2 deletions

View File

@ -952,6 +952,7 @@ The latest dev versions are on github
3.0.1
- fix a bug where :NERDTreeToggle was broken unless 'hidden was set
- make the q mapping work with secondary (:e <dir> style) nerd trees
- more insane refactoring and doc updates
3.0.0

View File

@ -3004,7 +3004,7 @@ function! s:bindMappings()
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapChdir ." :call <SID>chCwd()<cr>"
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapQuit ." :NERDTreeToggle<cr>"
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapQuit ." :call <SID>closeTreeWindow()<cr>"
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapRefreshRoot ." :call <SID>refreshRoot()<cr>"
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapRefresh ." :call <SID>refreshCurrent()<cr>"
@ -3162,7 +3162,15 @@ function! s:closeCurrentDir()
call treenode.parent.putCursorHere(0, 0)
endif
endfunction
" FUNCTION: s:closeTreeWindow() {{{2
" close the tree window
function! s:closeTreeWindow()
if b:NERDTreeType == "secondary"
buffer #
else
wincmd c
endif
endfunction
" FUNCTION: s:copyNode() {{{2
function! s:copyNode()
let currentNode = s:TreeFileNode.GetSelected()