I'm not having the problem listed in that thread. I get the fold markers in the correct places. It's that it won't fold them correctly. More simply it won't fold the end delimiter of a block. So all folded code takes up 2 lines instead of 1.

well if you cared to read my explanation in that thread you might have understood why it's behaving like that.it has nothing to do with context blocks. Sublime doesnt fold contextual blocks of code. What it does is track indentation levels of consecutive lines and provide fold markers where following indented lines are greater than 1.http://www.sublimetext.com/forum/viewtopic.php?f=2&t=10005

vitaLee wrote:well if you cared to read my explanation in that thread you might have understood why it's behaving like that.it has nothing to do with context blocks. Sublime doesnt fold contextual blocks of code. What it does is track indentation levels of consecutive lines and provide fold markers where following indented lines are greater than 1.http://www.sublimetext.com/forum/viewtopic.php?f=2&t=10005

I did read it. Again I'm not having a problem with that. The fold markers are in the correct spot. All my code has at least 2 lines with indentation. I'll use one of your examples in fact:

Leaving the last line hanging instead of folding it. I understand what you're saying though. Essentially sublime can't fold ANY languages delimiter unless it's indented vs the starting marker of a code block? Should that be bug reported maybe? That pretty much breaks every readability rule I've ever heard of.

Essentially sublime doesn't AT ALL recognize syntactical blocks of code and add folding behaviour based on that. No block delimeters or keywords are considered.It's way simple than that. Consider this example:Syntax: Plain Text

Screen shot 2012-11-19 at 10.52.53.png (10.44 KiB) Viewed 4020 times

Unless Sublime is aware of language block delimeters, there's no way to consistently handle folding of block in different languages, thus John resorted to this simple solution.Which admittedly is not perfect and at times is even annoying.

Yes, tmLanguage files used by sublime have <key>foldingStartMarker</key> and <key>foldingStopMarker</key>in their XML which makes makes it surprising that Jon's opted for such a simple and limited approach to folding. I'd love to see this improve, together with sublime remembering folds between sessions and even within the project/workspace files.

There are also issues with folded section cut, copy and paste behaviour. Folding is messy and buggy at present, and could really do with a bit of an overhaul.