Sublime Forum

Code folding issue

#1

I don’t remember exactly when, but some while ago there was a big change in the way ST folds the code. Before that, it was indentation based, after that it is syntax based.
For me, the new change made some things better, some other thins worse.
I coding in Tcl and the syntax for if/else looks like this (similar to C):

if {expression1} {body1} elseif {expression2} {body2}

I usually ident the code like this:

if {expression1} {
    body1
} elseif {expression2} {
    body2
}

Now, if I press the code folding keys on my keyboard, the code is folded like in the picture below:

Unbenannt

From this situation, I cannot unfold the “elseif” branch and leave the “if” branch folded using the triangles on the row numbers column. It’s practically impossible. I have to unfold very branch in order to see the “body2” code.

Furthermode, for if/else constructs with multiple branches, it’s impossible to fold e.g. branch1 and then branch2 and then branch3 and so on. And this is something I need very often when searching the code for something. I look at the condition of branch1 and if this condiction is not relevant for me, I fold branch1. Then, I look at the condition of branch2, and if this is also not relevant, I want to fold branch2. But exactly this is not possible anymore because branch1 is already folded.

I hope you get the idea and hope that there is a solution for this, since the issue started with the change to syntax based code folding.

Many thanks
Alexandru

0 Likes

#2

This is already fixed in the current dev builds.

0 Likes

#3

Thank you for the fast reply.
Looking forward for the next stable release.

0 Likes