[TxMt] Broken code folding (javascript)

Kyle Kirbatski kyle.kirby at me.com
Mon Oct 7 14:31:47 UTC 2019


I’ve noticed this a lot and I’m wondering if there is anyway to fix it.

If I have this code:

function findEnvironmentConfig(environment, config) {
	if (!Array.isArray(environment)) {
		environment = [environment];
	} else {
		// Clone the array so any mutations aren't received on the other end
		environment = [...environment];
	}
}

And try to code fold on the line "if ( !Array.isArraty(environment)) {“ then it ends up folding the entire function declaration.

How can I make this work as expected? I have a sneaky suspicion that this is a fatal flaw with TextMate.

Note, this works if  the “else {“ is on its own line.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macromates.com/textmate/attachments/20191007/8af172ba/attachment.html>


More information about the TextMate mailing list