Wed, 16 Mar 2005 17:36:06 +0100
Le Mercredi 16 Mars 2005 17:36, Bram Moolenaar a =E9crit=A0:
> Pierre -
> > > OK, that problem I can see. Strange, why would the rule work one
> > > time and not the other time. I'll look into it. I don't want to
> > > add ".gz", I want to fix the real problem.
> > Agreed.
> > So let me informed when you have a real solution ;)
> The good solution is a bit complicated.
> What happens is that the pattern [cC]hange[lL]og* matches
> changelog.Debian.gz. It then checks the first line for "urgency =3D",
> but since the file is still compressed it doesn't match and sets the
> filetype to "changelog". After decompressing the file the filetype
> is already set and won't be changed.
> To avoid this I made all filetype checks with a pattern ending in a
> "*" compare the filename against g:ft_ignore_pat. I do this in a
> function, called from many places. This is too complicated to
> include in the stable 6.3 version. I have changed it for Vim 7.
> If you want a temporary fix, use something like this (untested):
> " Changelog
> au BufNewFile,BufRead [cC]hange[lL]og*
> \ if expand("<amatch>") !~ g:ft_ignore_pat
> \ if getline(1) =3D~ '; urgency=3D'
> \| call s:StarSetf('debchangelog')
> \| else
> \| call s:StarSetf('changelog')
> \| endif
> - Bram
thank you very much.
I'll have a look at it then
=B7O=B7 Pierre Habouzit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Signed by Pierre Habouzit <email@example.com>
-----END PGP SIGNATURE-----