commit 2f4d1b93e85d0181f7c1be9b1b564a1799308070
parent f06d99f7b5a5db89519afa7e2b9f64d0a69f7cb3
Author: Martin Grenfell <martin_grenfell@msn.com>
Date: Fri, 9 Jan 2009 14:46:49 +1300
make the q mapping work with secondary trees
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt
@@ -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
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -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()