Sublime Forum

ST4: Code Folding Resets Previous Folds

#1

Before syntax based code folding was introduced, folding by a certain level (Ctrl + K, Ctrl + #) would persist across multiple code folds.

For example, folding on 1st level, then manually expanding an element (or using the unfolded element where the mouse was positioned) and folding on the 2nd level will only apply to the expanded elements and leave the 1st level folds intact.

Now, If you fold on the 1st level, then open an element, then fold an inner level, the 3rd level in the screenshot. Everything will be folded to the 3rd level, including what was initially folded to the 1st level.

Is there a way to have the previous behavior back? Maybe a setting to only fold the unfolded code?

1 Like

#2

That’s an interesting finding. New folding mechanism also doesn’t respect selections anymore as it is said to have been a bug. Fold by level applies to the whole document as of ST4130 and there’s no way to change that.

0 Likes