cf-utils.vim icon indicating copy to clipboard operation
cf-utils.vim copied to clipboard

Syntax: nested strings in cfHashRegion

Open Tomalak opened this issue 11 years ago • 3 comments

In syntax/cfml.vim you ask "Which is better?", and clearly the commented-out version is.

With structures like these it breaks:

<cfquery>
  SQL syntax here...
  <cfqueryparam value="#Replace(value, "foo", "bar")#">
  more SQL syntax here...
</cfquery>

In the syn match the string started by value=" version bleeds over the end of the <cfqueryparam> and messes up much of the rest of the file. (You can see that GitHub's CFML highlighting messes this up in a similar way.)

The syn region version does a much better job here. Not sure if adding a keepend improves things (maybe performance-wise?) - anyway, it does not seem to make it worse.

Your thoughts?

Tomalak avatar Jun 10 '14 09:06 Tomalak

Your comment makes sense. I'd encourage to open a pull request with some screen shots of the different implementations. I'm not doing much CFML development these days, so I'm sad to say that this repo is falling behind.

davejlong avatar Jun 11 '14 11:06 davejlong

Sad to hear you've more or less abandoned this. I do quite a bit of CF development but I don't know enough about vim script (and syntax definitions in particular) to confidently take over the repo. :/

Note that <cfquery> and some other tags (<cfmail> for example) behave like <cfoutput> is enabled, so hash regions should be properly highlighted inside. That's currently not working either. As soon as I've figured this out I'll send you a pull request.

Tomalak avatar Jun 11 '14 17:06 Tomalak

What you’ll probably want to look at is the containedin attribute of the cfHashRegion match and the cfOutputRegion. Can’t remember if you can pass a list to the containedin attribute or not.

You could also modify the cfOutputRegion regular expressions to match cfoutput, cfmail and cfquery.


As sad as it is to move away from my first love in the programming world, I'm enjoying working with other languages very much (specifically a big focus on Ruby and JavaScript).

davejlong avatar Jun 11 '14 20:06 davejlong