Re: FileType bug ?
- Bram Moolenaar (Bram@...) wrote :
> Doing ":syntax on" has a side effect: It will trigger the filetype events, sotest results:
> 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
> 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:
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:
Undefined variable: s:did_ft
Invalid expression: s:did_ft
:else without :if: else
No such event: filetypedetect BufRead
: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 :-(
Very bad. VERY BAD.
Sorry about that...
- Martin Keseg wrote:
> test results:Won't work. This syntax.vim I sent was made for Vim 6.0d. It uses the new
> vim 5.7 and new syntax.vim
script-local s: variables.
> vim 5.7 and old syntax.vim(default from instalation)OK.
> the if !exists("syntax_on")... workaround works.
> vim 6.0d new syntax.vimStrange. There must be something else interfering. Try setting the 'verbose'
> 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 :-(
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 ///