pvk7 / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

[syntax patch proposal] config.vim recognize AC_MSG as strings #133

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In configure.ac scripts, the AC_MSG_ERROR([...]) defines a string environment. 
This patch makes vim syntax recognize this correctly, and I also made the 
educated guess that this more generally holds for any AC_MSG_[A-Z]*([...]) 
environments.

The trouble with not detecting this is that you can have ' or ` inside these 
strings, which are then defining a string environment until the next occurence 
of ' or ` according to the current syntax file. This causes in my case huge 
'string environments' which makes the syntax highlighting kind of pointless.

I also reduced two lines for comment recognition by using \z(\).

And fixed one spelling mistake in the comments. Please find the patch attached. 
Please also note I am no expert in writing these syntax files, so please feel 
free to edit as you see fit!

Minor comment:
I was originally hoping that this would work because I thought it would be 
cleaner:
syn region  configstring start="AC_MSG_[A-Z]*"ms=s+14 end="\])"me=e-2

However, the ms=s+14 does not work somehow. Is this a bug? If I used hs=s+14 
instead it is fine, but then the AC_MSG_ part and ([ is not highlighted as they 
should.

Original issue reported on code.google.com by yngve.le...@gmail.com on 10 May 2013 at 3:26

Attachments:

GoogleCodeExporter commented 9 years ago
This should be taken to the maintainer of that particular syntax file. I wrote 
him a short message to take a look at this patch.

Original comment by chrisbr...@googlemail.com on 9 Oct 2014 at 9:21

GoogleCodeExporter commented 9 years ago
maintainers email bounces. You might want to include the patch nevertheless.

Original comment by chrisbr...@googlemail.com on 9 Oct 2014 at 9:34

GoogleCodeExporter commented 9 years ago

Original comment by chrisbr...@googlemail.com on 9 Jan 2015 at 12:28

GoogleCodeExporter commented 9 years ago
Thanks.  I'll check for ([message]) and (message) separately, otherwise the end 
isn't recognized properly.

Original comment by brammool...@gmail.com on 14 Jan 2015 at 3:58