Folding line 3 or 15 will “eat” the “else” and make “else” unfordable.
Basically ST 4143 added a fix to not include trailing newline in folding blocks by default, to avoid this kind of issue. It turned however out it doesn’t work as expected if leading whitespace is involved.
The issue is tracked at https://github.com/sublimehq/sublime_text/issues/5733
There are other issues, see second screenshot for something that shouldn’t fold, but it does.
The second screenshot shows a minified function, which still spans 4 lines of code with a function block beginning at the end of line 1.
Hence syntax based folding applies as expected per design. Note folding no longer relies on indentation levels only but also on certain fold-begin and fold-end markers. An opening brace is such a marker, which denotes the beginning of a fold region.
HTML’s tag can’t be folded at all - see third screenshot. And within style, indentation based folding is completely gone
same as Can No Longer Fold HTML <style> tags
It is caused by indentation based folding being disabled for CSS.sublime-syntax. As source.css
starts immediately after <style>
tag CSS’s folding rules apply.
A fix is proposed at https://github.com/sublimehq/Packages/pull/3601
I have a feeling we should never disable indentation based folding.