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!