I'm trying to create a patch for cf.vim
to resolve an issue with hashes. In ColdFusion, #
signs are used to enclose an expression inside a cfoutput
block.
<cfset x = 1 />
<cfoutput> x is now #x# </cfoutput>
<!--- outputs "x is now 1" --->
The problem comes into play when there is a lone #
, not inside a cfoutput
block:
<a href="#x">an anchored link</a>
This will cause vim to highlight everything after the #
as if it were in a cfHashRegion
.
syn region cfHashRegion start=+#+ skip=+"[^"]*"\|'[^']*'+ end=+#+ contained containedin=cfOutputRegion contains=@cfExpressionCluster,cfScriptParenError
syn region cfOutputRegion matchgroup=NONE transparent start=+<cfoutput>+ end=+</cfoutput>+ contains=TOP
Is there something I can add to cfHashRegion
to tell vim "Don't enter a cfHashRegion unless the start and end properties are both found?
Super-bonus: cfoutput
is only the most common way to be in a "cfOutputRegion". Any cffunction
with output="true" will behave as if everything inside its block were wrapped in cfoutput
tags.