ColdFusion icon indicating copy to clipboard operation
ColdFusion copied to clipboard

Closing curly bracket and cursor position inside tag based cfc <cfscript> block is indented one tabstop to the left of where it should be

Open joshwines opened this issue 13 years ago • 5 comments

Only happening inside tag based CFCs. Fully scripted CFCs and <cfscript> blocks in .cfm files are good.

Given the following code, '|' being the cursor position:

<cffunction>
    <cfscript>
        if (a == b)
        {|}
    </cfscript>
</cffunction>

Hitting enter comes out like:

<cffunction>
    <cfscript>
        if (a == b)
        {
        |
    }
    </cfscript>
</cffunction>

joshwines avatar Sep 07 '12 01:09 joshwines

Thanks @joshwines

I can't think of an immediate way to fix this. I'll try to find some time to look into it over the weekend. Hopefully it's something that can be fixed through this package and not something hard coded into Sublime...

atomi avatar Sep 07 '12 06:09 atomi

I think this should be enough to fix this particular issue. There may be more problems with square brackets or parens. I haven't tested so let me know if you come across any weird behavior.

Thanks again!

atomi avatar Sep 08 '12 18:09 atomi

Thanks, looking good.

joshwines avatar Sep 09 '12 00:09 joshwines

I still have this issue. I've checked my files to be sure I'm using the latest release. Capture

RichardH9L avatar Apr 18 '13 11:04 RichardH9L

Did some investigation this morning because this has been driving me nuts. Found that the following commit broke it again:

df6870375d9a5c87bbc6b6a0d5bb118af64ec586

The particular lines that broke it were the removal of 34. and 35. in ColdFusion.tmLanguage:

<key>name</key>
<string>meta.tag.block.cf.script.cfml</string>

I've fixed it locally by adding those lines back in but I presume they were removed for a reason and I don't really understand the code so haven't made a commit and pull request.

HTH

Dominic

DominicWatson avatar Aug 01 '13 08:08 DominicWatson