From 708dab5f9abb58b7aed57c5324bf8f7c5241adb1 Mon Sep 17 00:00:00 2001 From: kphoen Date: Mon, 27 Jun 2011 21:19:43 +0200 Subject: [PATCH 1/2] 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 --- plugin/taglist-plus.vim | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/plugin/taglist-plus.vim b/plugin/taglist-plus.vim index 98f02a2..a5df6c1 100644 --- a/plugin/taglist-plus.vim +++ b/plugin/taglist-plus.vim @@ -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 From ed1c46ad4a204b91fbc73104842a756837b40614 Mon Sep 17 00:00:00 2001 From: kphoen Date: Mon, 27 Jun 2011 21:20:24 +0200 Subject: [PATCH 2/2] Chg: updated README.md for the new filetypes behavior modified: README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e883760..91589cf 100644 --- a/README.md +++ b/README.md @@ -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] 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]. Installation