Home Download Buy Blog Forum Support

Block collapse behavior

Block collapse behavior

Postby sp00x on Tue Dec 04, 2012 12:36 pm

I'm not sure if this is intentional or just accidental:

If you have a JS function, e.g. (nonsense content here)

Code: Select all
function foo()
{
   var a = "hello";
   a = a + a;
//   alert(a);
   return a;
}


If you collapse on the opening bracket, it will collapse to:

Code: Select all
function foo()
{ (..)
//   alert(a);
   return a;
}


I guess this is because the // is at the same level as the opening bracket, and it collapses until it finds something else at that position, but in this case it is not the "}", but rather the "/" of "//". (It collapses nicely if you place some whitespace before //.)

Is this a bug, or just a side-effect of how the collapse functionality works?
sp00x
 
Posts: 1
Joined: Tue Dec 04, 2012 12:31 pm

Re: Block collapse behavior

Postby vitaLee on Tue Dec 04, 2012 1:57 pm

it's a side-defect. :)
vitaLee
 
Posts: 150
Joined: Tue Dec 27, 2011 11:10 pm

Re: Block collapse behavior

Postby bronson on Tue Dec 04, 2012 5:43 pm

The blog gives some hope...
There’s still more functionality to come in the future from Code Folding, notably the ability to fold based on syntactic blocks in addition to indented blocks.
-- http://www.sublimetext.com/blog/article ... build-2126
bronson
 
Posts: 38
Joined: Wed Nov 28, 2012 8:52 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 21 guests