rodjek / vim-puppet

Puppet niceties for your Vim setup
Apache License 2.0
502 stars 137 forks source link

Don't delete all autocmds when reading or opening a file #126

Closed lelutin closed 3 years ago

lelutin commented 3 years ago

The effect of the ! after the au keyword is that all autocommands get removed and then this one gets added.

This could potentially hide some other autocommands that would be supplied by other plugins or user scripts that get loaded before this plugin.

As far as I can see, other plugins that set the filetype don't use the ! after au.

lelutin commented 3 years ago

I'm actually having trouble with this change. .pp files get recognized as pascal

apparently this file is evaluated before the vim-puppet plugin and it jumps on the filetype before us, preventing the plugin to set it to puppet:

/usr/share/vim/vim82/filetype.vim:au BufNewFile,BufRead *.pas,*.pp      setf pascal
lelutin commented 3 years ago

the problem that I was trying to address here was that I sometimes get the wrong type detected for embedded puppet files -- I've had some show up as "mason" instead for example.

I'll think about it some more and do some testing. I'll report the problem about file type detection with a simple case to reproduce and then we can work better from there.