Collapsing code AKA Code folding

What about Collapsing code into code editor.

Look here:

Collapsing code in Codea Code Editor

Another example:

Collapsing code in XCode Java on Mac OS

For more details:

What do you think?

I would LOVE code folding.


Let me say “I’ll buy THAT for a dollar.”

Agreed. Also click and drag lines? :slight_smile:

I would like this feature as well. I’ve been thinking for a long time about the best way to put it in.

TripleTap the word “function”. The word is fairly large and easy to hit. Currently: SingleTap places the cursor (and raises the keyboard if not raised). DoubleTap highlights a word and brings up copy/paste etc. TripleTap changes the behavior from DoubleTap to SingleTap.

PressHold would interfere with the cursor magnifying glass.

Well I was thinking you tap the function marker in the gutter to fold / unfold. However my main issue is designing how to implement such a feature within the current editor code base.

I’m with you on the mechanism, @Simeon. The function marker looks plenty big to act as a handle.

I suspect the function marker alone would be too small a target for my giant fingers.

But - if that and the word ‘function’ after it were a tap target - it would be fine. I can’t think of why I’d ever want to tap on the word to edit it, so it should be fine.

@Bortels it would have a much larger hit radius than the visual target.

Works for me. Function folding would be neat. (We also need a search, just sayin. But you knew that.)

Mabey make it a swipe right to show and left to hide.

One option that I’d definitely pay for: the ability to increase font sizes, especially the line numbers. At my age, all those little blurs could just say 999 and I wouldn’t know the difference the way it’s sized now.

@Mark, I agree with you. I can pay $1 for: Dark Keyboard, Collapsing code and Font Size / Font Family for code editor. 8->

Folding functions would be excellent.

What about increasing size of line numbers and SingleTap on them?

+1 for code folding

Code foldin fer mah hurtin’ noggin!!

I guess this will be one of the most anticipated features.

When you have a project with more than 2,000 lines, scrolling the screen can feel like a heavy burden

Absolutely agree! Code folding would be extremely handy, but maybe have it optional.