textmate / bugs

Bug tracker for TextMate (not its bundles, nor tracking feature requests)
4 stars 0 forks source link

Else if block folding #25

Closed RblSb closed 5 years ago

RblSb commented 7 years ago

Every language bundle have this folding: default

As a result, folding does not work as required, if I understand correctly, because of the conflict foldingStartMarker and foldingStopMarker on one line.

I would suggest, if they are both on the same line, completely ignore the existence of any of them on this line.

If this solution breaks any bundles, maybe you know the regex fix for this case? Tested with: {foldingStartMarker = '\{\s*(//.*)?$|\[\s*(//.*)?$|\(\s*(//.*)?$'; foldingStopMarker = '^\s*\}|^\s*\]|^\s*\)'; }

sorbits commented 5 years ago

The folding start marker “wins” so TextMate currently sees the middle line as a start marker and allows folding the latter block.

If this is undesired, one could update the pattern to specifically handle the case where a line is both a start and stop marker, and not match on such lines.

Closing issue as this is not considered a bug in TextMate.