Sublime Forum

Can I revert back to the old code folding?

#1

Since the new syntax based code folding is a mess with Tcl code at least, can I revert back to the old code folding?

In addition, even if the bugs are fixed in the future, it would be a good idea to handle comments with the old folding. I use to create comment blocks with indentation so that I can even fold comment blocks. With the newest update this is gone which is a big pitty.

0 Likes

#2

Since the new syntax based code folding is a mess with Tcl code at least, can I revert back to the old code folding?

Can you describe in what way it’s a mess?

In terms of having indentation-based folding, the new folding is configured by the syntax. For TCL it’s in TCL/Fold.tmPreferences where indentationFoldingEnabled is set to false.

0 Likes

#3

Well, since ST has some issues with Tcl syntax, you can derive from that, that also the syntax based code folding will not work.

I couldn’t find any Fold.tmPreferences on my computer.
I added the line “indentationFoldingEnabled”: true to my preferences file, but there is not effect. The code folding is still syntax based.

0 Likes

#4

TCL/Fold.tmPreferences can be found here: https://github.com/sublimehq/Packages/blob/master/TCL/Fold.tmPreferences. It’s inside the compressed default packages, so you won’t find it directly on your filesystem. Placing a Fold.tmPreferences file in your Packages/TCL folder (Preferences > Browse Packages…) will override the default one. Though I’d suggest using OverrideAudit if you plan on overriding default packages long-term.

1 Like

#5

Many thanks, that worked.

0 Likes

#6

I’m going to have to echo this topic. My workflow was totally messed up by this change because I use a combination of tabs, comments, and code folding to organize code in long code files. Particularly in CSS files I would argue that tab-based folding should be the default since the new folding will only ever fold about 4 lines per block.

fold

I don’t update software that already works on my home computer for exactly reasons like this so thankfully I’m fine for the most part, but I implore adding a setting for tab-based folding, ideally purely tab-based with no “smartness” to it whatsoever. I tried to make a Fold.tmPreferences file as instructed for CSS, but could not get it to do anything.

0 Likes

#7

This issue is being tracked here: https://github.com/sublimehq/sublime_text/issues/5709

0 Likes