Loading ...
Sorry, an error occurred while loading the content.

Multiple FileTypes

Expand Messages
  • trindade.joao
    Hi, First of all, I apologize if the question is repeated. I ve searched in the mailing list and haven t found any post relating to this issue. I can t
    Message 1 of 2 , Aug 15 4:01 PM
    • 0 Attachment
      Hi,

      First of all, I apologize if the question is repeated. I've searched
      in the mailing list and haven't found any post relating to this issue.

      I can't correctly use taglist if the filetype variable is set multiple
      filetypes.

      In my case my python files have two filetypes:

      :set filetype
      filetype=python.django

      I'm using the "dot" to separate the filetypes as is explained in the
      vim manual:

      "
      When a dot appears in the value then this separates two filetype
      names. Example:
      /* vim: set filetype=c.doxygen : */ ~
      "

      If I change the filetype only to python, everything works ok.

      Is there anyway to correct this (without changing the filetype)? I've
      tried to extend taglist to recognize a new language (python.django)
      but the dot isn't legal in the variable:

      tlist_python.django_settings = "......."

      Any other suggestion?

      Thanks for the attention and thanks for the great work done with taglist!
    • jceb81
      Hi, I ran into the very same problem. The problem lies in taglist. It actually looks for the variable you defined - with the dot within the variable s name.
      Message 2 of 2 , May 2, 2010
      • 0 Attachment
        Hi,

        I ran into the very same problem. The problem lies in taglist. It actually looks for the variable you defined - with the dot within the variable's name. The function Tlist_Get_Buffer_Filetype should fix this issue by either offering a proper name for multiple filetypes, i.e. replace dot by underscore -> tlist_python_django_settings, or just using the first filetype.

        I decided to implement the latter because it seems to me that the 2nd, 3rd ... filetypes are just extensions that don't matter for taglist.


        Index: vim/.vim/plugin/taglist.vim
        ===================================================================
        --- vim.orig/.vim/plugin/taglist.vim 2010-05-02 14:18:45.000000000 +0200
        +++ vim/.vim/plugin/taglist.vim 2010-05-02 14:30:38.000000000 +0200
        @@ -981,7 +981,11 @@
        " Tlist_Get_Buffer_Filetype
        " Get the filetype for the specified buffer
        function! s:Tlist_Get_Buffer_Filetype(bnum)
        - let buf_ft = getbufvar(a:bnum, '&filetype')
        + let buf_fts = split(getbufvar(a:bnum, '&filetype'), '\.')
        + if len(buf_fts) == 0
        + let buf_fts[0] = ''
        + endif
        + let buf_ft = buf_fts[0]

        if bufloaded(a:bnum)
        " For loaded buffers, the 'filetype' is already determined

        Greetings,

        Jan Christoph

        --- In taglist@yahoogroups.com, "trindade.joao" <trindade.joao@...> wrote:
        >
        > Hi,
        >
        > First of all, I apologize if the question is repeated. I've searched
        > in the mailing list and haven't found any post relating to this issue.
        >
        > I can't correctly use taglist if the filetype variable is set multiple
        > filetypes.
        >
        > In my case my python files have two filetypes:
        >
        > :set filetype
        > filetype=python.django
        >
        > I'm using the "dot" to separate the filetypes as is explained in the
        > vim manual:
        >
        > "
        > When a dot appears in the value then this separates two filetype
        > names. Example:
        > /* vim: set filetype=c.doxygen : */ ~
        > "
        >
        > If I change the filetype only to python, everything works ok.
        >
        > Is there anyway to correct this (without changing the filetype)? I've
        > tried to extend taglist to recognize a new language (python.django)
        > but the dot isn't legal in the variable:
        >
        > tlist_python.django_settings = "......."
        >
        > Any other suggestion?
        >
        > Thanks for the attention and thanks for the great work done with taglist!
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.