make t/T open a new tree in a new tab, not netrw

doesnt work for paths with some screwed up chars in them
This commit is contained in:
Martin Grenfell 2008-07-05 12:15:28 +12:00
parent 3cb3227d56
commit fd487dfa5c

View File

@ -1486,6 +1486,18 @@ function! s:oPath.StrForGlob() dict
endif
return toReturn
endfunction
"FUNCTION: oPath.StrForNERDTreeCmd() {{{3
"
"Return: the string for this path that is suitable to be used with the
":NERDTree command
function! s:oPath.StrForNERDTreeCmd() dict
if s:running_windows
return self.StrForOS(0)
else
return self.Str(1)
endif
endfunction
"FUNCTION: oPath.StrForOS(esc) {{{3
"
"Gets the string path for this path object that is appropriate for the OS.
@ -3201,9 +3213,10 @@ function! s:OpenInNewTab(stayCurrentTab)
let treenode = s:GetSelectedNode()
if treenode != {}
exec "tabedit " . treenode.path.StrForEditCmd()
if a:stayCurrentTab
exec "tabnext " . currentTab
if treenode.path.isDirectory
exec "tabnew +NERDTree\\ " . treenode.path.StrForNERDTreeCmd()
else
exec "tabedit " . treenode.path.StrForEditCmd()
endif
else
let bookmark = s:GetSelectedBookmark()
@ -3213,11 +3226,11 @@ function! s:OpenInNewTab(stayCurrentTab)
else
exec "tabedit " . bookmark.path.StrForEditCmd()
endif
if a:stayCurrentTab
exec "tabnext " . currentTab
endif
endif
endif
if a:stayCurrentTab
exec "tabnext " . currentTab
endif
endfunction
" FUNCTION: s:OpenNodeRecursively() {{{2