Sublime Forum

Syntax based code folding

#1

I know this was discussed way back in 2011 (Dev Build 2136) but I was wondering if syntax based code folding was something that could be introduced in a future release. I know there are some significant changes to syntax happening right now, and I wanted to pose the question.

The language I work in primarily uses if/end if blocks. Usually if there is a code block that is started, there will be a matching ending keyword to denote to break out of the block (While/end while, for/end for, etc.). This would be extremely helpful when trying to work with our code as comments are usually left in the first character on a line rather than following the indentation (old convention that we have never moved away from…and it drives me nuts!). Long story short, since we style our comments this way folding never works properly.

Just an idea but maybe sublime could have it’s default style of code folding settings and then we could have an override for each syntax similar to how comments are done with the tmPreferences files (I know this is the old style of doing things, but something along these lines).

2 Likes

#2

I have the same problem with preprocessor directive in C#,
As they start on the first character of the line they break folding.

0 Likes