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

Re: FileType bug ?

Expand Messages
  • Martin [Keso] Keseg
    ... test results: vim 5.7 and new syntax.vim ~/.vim/mail contains only :syntax on /tmp/mutt-krowak-14690-3 37L, 903C Error detected while processing
    Message 1 of 7 , Aug 1, 2000
    • 0 Attachment
      Bram Moolenaar (Bram@...) wrote :


      > Doing ":syntax on" has a side effect: It will trigger the filetype events, so
      > that the syntax highlighting will be switched on for all buffers currently
      > open. Since you use the filetype event to switch on syntax highlighting, you
      > get an endless loop.
      >
      > The solution for you is using this in ~/.vim/mail:
      >
      > if !exists("syntax_on")
      > syntax on
      > endif
      >
      > I could try to trigger only the "syntaxset" autocommands. That requires
      > detecting that the filetypes are already detected. Try using this
      > $VIMRUNTIME/syntax/syntax.vim instead:

      test results:

      vim 5.7 and new syntax.vim

      ~/.vim/mail contains only :syntax on

      "/tmp/mutt-krowak-14690-3" 37L, 903C
      Error detected while processing /usr/local/share/vim/vim57/syntax/syntax.vim:
      line 38:
      Undefined variable: s:did_ft
      Invalid expression: s:did_ft
      line 40:
      :else without :if: else
      line 41:
      No such event: filetypedetect BufRead
      line 42:
      :endif without :if: endif
      Press RETURN or enter command to continue

      I got the same error with if !exists("syntax_on")... in ~/.vim/mail

      vim 5.7 and old syntax.vim(default from instalation)

      the if !exists("syntax_on")... workaround works.

      vim 6.0d new syntax.vim

      the if !exists("syntax_on")... workaround does not works.

      vim 6.0d and old syntax.vim

      the if !exists("syntax_on")... workaround does not works too :-(


      --
      Keso
      Very bad. VERY BAD.
      Sorry about that...
    • Bram Moolenaar
      ... Won t work. This syntax.vim I sent was made for Vim 6.0d. It uses the new script-local s: variables. ... OK. ... Strange. There must be something else
      Message 2 of 7 , Aug 1, 2000
      • 0 Attachment
        Martin Keseg wrote:

        > test results:
        >
        > vim 5.7 and new syntax.vim

        Won't work. This syntax.vim I sent was made for Vim 6.0d. It uses the new
        script-local s: variables.

        > vim 5.7 and old syntax.vim(default from instalation)
        >
        > the if !exists("syntax_on")... workaround works.

        OK.

        > vim 6.0d new syntax.vim
        >
        > the if !exists("syntax_on")... workaround does not works.
        >
        > vim 6.0d and old syntax.vim
        >
        > the if !exists("syntax_on")... workaround does not works too :-(

        Strange. There must be something else interfering. Try setting the 'verbose'
        option and find out what happens.

        --
        hundred-and-one symptoms of being an internet addict:
        63. You start using smileys in your snail mail.

        /// Bram Moolenaar Bram@... http://www.moolenaar.net \\\
        \\\ Vim: http://www.vim.org ICCF Holland: http://iccf-holland.org ///
      Your message has been successfully submitted and would be delivered to recipients shortly.