Fix: patched to handle composed filetypes (ex: when using php.symfony filetype,
Taglist will search for the php tags file) modified: plugin/taglist-plus.vim
This commit is contained in:
parent
fc9f1c8437
commit
708dab5f9a
|
@ -950,6 +950,17 @@ function! s:Tlist_FileType_Init(ftype)
|
|||
return 1
|
||||
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
|
||||
" Determine the filetype for the specified file using the filetypedetect
|
||||
" autocmd.
|
||||
|
@ -972,7 +983,7 @@ function! s:Tlist_Detect_Filetype(fname)
|
|||
let &filetype = old_filetype
|
||||
let &eventignore = old_eventignore
|
||||
|
||||
return ftype
|
||||
return s:Tlist_Fix_Ftype(ftype)
|
||||
endfunction
|
||||
|
||||
" Tlist_Get_Buffer_Filetype
|
||||
|
@ -982,12 +993,12 @@ function! s:Tlist_Get_Buffer_Filetype(bnum)
|
|||
|
||||
if bufloaded(a:bnum)
|
||||
" For loaded buffers, the 'filetype' is already determined
|
||||
return buf_ft
|
||||
return s:Tlist_Fix_Ftype(buf_ft)
|
||||
endif
|
||||
|
||||
" For unloaded buffers, if the 'filetype' option is set, return it
|
||||
if buf_ft != ''
|
||||
return buf_ft
|
||||
return s:Tlist_Fix_Ftype(buf_ft)
|
||||
endif
|
||||
|
||||
" Skip non-existent buffers
|
||||
|
|
Loading…
Reference in New Issue