Sublime Forum

Block collapse behavior

#1

I’m not sure if this is intentional or just accidental:

If you have a JS function, e.g. (nonsense content here)

function foo() { var a = "hello"; a = a + a; // alert(a); return a; }

If you collapse on the opening bracket, it will collapse to:

function foo() { (..) // alert(a); return a; }

I guess this is because the // is at the same level as the opening bracket, and it collapses until it finds something else at that position, but in this case it is not the “}”, but rather the “/” of “//”. (It collapses nicely if you place some whitespace before //.)

Is this a bug, or just a side-effect of how the collapse functionality works?

0 Likes

#2

it’s a side-defect. :smile:

0 Likes

#3

The blog gives some hope…

[quote]There’s still more functionality to come in the future from Code Folding, notably the ability to fold based on syntactic blocks in addition to indented blocks.
sublimetext.com/blog/article … build-2126
[/quote]

0 Likes