Home Download Buy Blog Forum Support

Code folding - doesn't use tmbundle foldingStartMarker?

Code folding - doesn't use tmbundle foldingStartMarker?

Postby geerlingguy on Wed Jun 27, 2012 10:19 pm

It seems that Sublime uses tmbundles for language definitions. When I was using TextMate, I modified the PHP.tmLanguage bundle so I could exclude comments from the code folding start/stop markers (foldingStartMarker / foldingStopMarker).

This way I could leave comments unfolded, but fold the functions and methods below them, like in the following code:

Code: Select all
* Comment is here (unfolded even if I do a 'fold all').
function my_function_here() {
  // This function would be folded if I did a 'fold all').

I changed the values in the PHP bundle for Sublime to what's below, but it seems to have no effect. The only thing I could find in Googling is an old/deprecated documentation page saying that those values weren't actually used by Sublime... but I would assume Sublime has some way to define start/stop markers for code folding, right?

Current code for folding:

Code: Select all

For TextMate, being able to customize my folding markers was a handy solution for my particular code folding needs (see: http://stackoverflow.com/questions/7689965/collapse-all-php-functions-in-textmate). Am I missing something here?

Alternatively, is there some other way for me to only fold functions/methods, and not the comments above them?
Posts: 2
Joined: Wed Jun 27, 2012 10:11 pm

Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot], jonathan.swoboda, Yahoo [Bot] and 10 guests