fREW Schmidt wrote:
> Hello all!
> 
> I develop perl and javascript.  I set up an error match (match Error 
> /,\_s*[)}\]]) so that trailing commas will get highlighted for js as 
> they crash IE.  I put that in after/ftplugin/javascript.vim.  The 
> problem is that if I open a js file and then a perl file that error 
> match is still around for perl.  Is there any way I can have this only 
> exist for javascript?  I tried putting syn match Error ..., but that 
> didn't work.  Any ideas?

The problem is that the matches aren't cleared when the filetype changes. They 
belong to the window and they stick. I suppose you could get Vim to clear 
matches 
whenever the filetype changes by putting this in your .vimrc:

:augroup ClearMatches
:au!
:au FileType * match
:augroup END

It's probably important for that to be before you turn on filetype detection or 
syntax highlighting in your .vimrc, because otherwise the autocommand will run 
after the filetype plugins and turn off the highlighting immediately, not when 
the 
filetype next changes!

Ben.






--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to