1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-18 12:00:23 +01:00

Move some tests to autoload

This commit is contained in:
Jan Larres
2011-07-15 17:34:47 +12:00
parent 4920be4438
commit 96d0050ea4
3 changed files with 55 additions and 52 deletions

View File

@@ -18,10 +18,53 @@
" use of this software.
" ============================================================================
scriptencoding utf-8
" Initialization {{{1
" Basic init {{{2
if v:version < 700
echomsg 'Tagbar: Vim version is too old, Tagbar requires at least 7.0'
finish
endif
if !exists('g:tagbar_ctags_bin')
if executable('ctags-exuberant')
let g:tagbar_ctags_bin = 'ctags-exuberant'
elseif executable('exuberant-ctags')
let g:tagbar_ctags_bin = 'exuberant-ctags'
elseif executable('exctags')
let g:tagbar_ctags_bin = 'exctags'
elseif executable('ctags')
let g:tagbar_ctags_bin = 'ctags'
elseif executable('ctags.exe')
let g:tagbar_ctags_bin = 'ctags.exe'
elseif executable('tags')
let g:tagbar_ctags_bin = 'tags'
else
echomsg 'Tagbar: Exuberant ctags not found, skipping plugin'
finish
endif
else
let g:tagbar_ctags_bin = expand(g:tagbar_ctags_bin)
if !executable(g:tagbar_ctags_bin)
echomsg 'Tagbar: Exuberant ctags not found in specified place,'
\ 'skipping plugin'
finish
endif
endif
redir => s:ftype_out
silent filetype
redir END
if s:ftype_out !~# 'detection:ON'
echomsg 'Tagbar: Filetype detection is turned off, skipping plugin'
unlet s:ftype_out
finish
endif
unlet s:ftype_out
if has('multi_byte') && has('unix') && &encoding == 'utf-8' &&
\ (empty(&termencoding) || &termencoding == 'utf-8')
let s:icon_closed = '▶'
@@ -45,6 +88,8 @@ let s:access_symbols = {
\ 'private' : '-'
\ }
let g:loaded_tagbar = 1
" s:InitTypes() {{{2
function! s:InitTypes()
let s:known_types = {}
@@ -2782,4 +2827,4 @@ function! tagbar#RestoreSession()
endfunction
" Modeline {{{1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1
" vim: ts=8 sw=4 sts=4 et foldenable foldmethod=marker foldcolumn=1