Functions collapsed

I am not sure what I did, but somehow I made everything collapse and look like this.

what did I do, and how do I reverse it?

You evidently typed in a keyboard shortcut to “fold all”. Since I don’t know what platform you’re using, I’ll point you to the Ace editor page showing keyboard shortcuts. Look for the one near the end of the list that indicates “unfold all”

Oops… https://github.com/ajaxorg/ace/wiki/Default-Keyboard-Shortcuts

There are little arrows beside the collapsed code (on the left side between the code and the line number) - you can also click on those to toggle whether or not the code is collapsed for that function/block/etc.

You can also click on the orange double-arrow to get that one block to expand. I find those an easier target than the arrows. However, I was remiss in even mentioning the quick way to get any block to expand. Thanks @beardedinventor!

While we’re on code folding, he’s a really cool trick (not sure if this is an ACE editor bug or not, but we sure exploit the heck out of it over here).

ACE will collapse multiline comments - but it does it in kind of a funny way. If you use the multiline comment syntax on a single line, it will collapse all of the code until it finds another line with a multiline syntax comment.

This let’s you do the following (it’s probably easier to just try this than for me to explain it):

`/********** LIBRARY CODE **********/
class SomeClass {
_a = null;
_b = null;
constructor(a, b) {
_a = a;
_b = b;
}

function someFunction() {
    return _a + _b;
}

}

class SomeOtherClass {
// code
}

/********** APPLICATION CODE **********/
someClass <- SomeClass(1,2);
someOtherClass <- SomeOtherClass();
server.log(someClass.someFunction());`

When you collapse the library code comment, you get the following:

@beardedinventor hope that isn’t a bug coz I’m using this from now, Ta.

Same here @controlCloud!

I think most people in our office use this little trick now :slight_smile: