On Sat, 2004-08-21 at 11:13, Thomas de Grenier de Latour wrote:
> Hi Steve,
> According to http://www.vim.org/htmldoc/filetype.html, to overide
> vim filetype detection, one should create a "ftdetect" directory
> somewhere in the runtime path, and add there a "something.vim"
> file with something like this:
> au BufRead,BufNewFile *.foobar set filetype=foobar
> That works fine with Vim, but gives several
> "E218: autocommand nesting too deep"
> errors with Cream (when opening a "something.foobar" file).
> The issue seems to be that during the filetype detection, the
> "set filetype=foobar" triggers a call to Cream_filetype(), which
> forces another "filtetype detect", etc. (well, something like
> this, that loops somewhere...)
> A possible fix is attached to this email. It splits the
> Cream_filetype() function in two parts:
> * Cream_filetype() is now only for detecting and setting
> filetype. It is used as an autocmd only for VimEnter and BufEnter.
> * Cream_filetype_setup() is the additional cream-specific setup
> for a few filetypes. It is the new autocmd for the FileType event.
> The patch also fixes a typo that prevents loading of
I'll have to look into this a bit more, the patch breaks Cream
filetype detection for me. A quick test has our filetype syntax
highlighting and commenting not being picked up.
I've always thought there was something broken about our filetype
stuff though, "filetype detect" seems heavy-handed just to add our
customizations per filetype. I'm probably doing something wrong.
Steve Hall [ digitect@... ]
Cream... the Vim text editor in sheep's clothing!