This commit is contained in:
Kirill Klenov 2011-09-27 16:30:53 +04:00
commit 2c54d67cee
2 changed files with 18 additions and 3 deletions

View File

@ -6,6 +6,10 @@ This is a fork of the popular taglist.vim plugin.
Taglist-plus provides excellent Javascript support via jsctags. See [here][1] Taglist-plus provides excellent Javascript support via jsctags. See [here][1]
for examples. for examples.
The filetype detection has also been improved: it now supports composed filetypes.
For instance, the _php.symfony_ filetype will be split and only its first part will
be considered.
This plugin can also be obtained through [vim.org][2]. This plugin can also be obtained through [vim.org][2].
Installation Installation

View File

@ -952,6 +952,17 @@ function! s:Tlist_FileType_Init(ftype)
return 1 return 1
endfunction endfunction
" Tlist_Fix_Ftype
" If the filetype is composed (foo.bar), only the part before the dot
" will be returned
function! s:Tlist_Fix_Ftype(raw_ftype)
if match(a:raw_ftype, '\.')
return split(a:raw_ftype, '\.')[0]
else
return a:raw_ftype
endif
endfunction
" Tlist_Detect_Filetype " Tlist_Detect_Filetype
" Determine the filetype for the specified file using the filetypedetect " Determine the filetype for the specified file using the filetypedetect
" autocmd. " autocmd.
@ -974,7 +985,7 @@ function! s:Tlist_Detect_Filetype(fname)
let &filetype = old_filetype let &filetype = old_filetype
let &eventignore = old_eventignore let &eventignore = old_eventignore
return ftype return s:Tlist_Fix_Ftype(ftype)
endfunction endfunction
" Tlist_Get_Buffer_Filetype " Tlist_Get_Buffer_Filetype
@ -984,12 +995,12 @@ function! s:Tlist_Get_Buffer_Filetype(bnum)
if bufloaded(a:bnum) if bufloaded(a:bnum)
" For loaded buffers, the 'filetype' is already determined " For loaded buffers, the 'filetype' is already determined
return buf_ft return s:Tlist_Fix_Ftype(buf_ft)
endif endif
" For unloaded buffers, if the 'filetype' option is set, return it " For unloaded buffers, if the 'filetype' option is set, return it
if buf_ft != '' if buf_ft != ''
return buf_ft return s:Tlist_Fix_Ftype(buf_ft)
endif endif
" Skip non-existent buffers " Skip non-existent buffers