Forum Archive

Feature request: code_folding

yjq01

Sometimes, I have to read long codes. So if Pythonista could fold “if”, “while” or “def”, it would be very convenient.
Example:

if a == 1:
print(True)
else:
print(False)
———————————-
[+] if a== 1: [...]

yjq01

@omz Please, it means a lot for me.

JonB

See:
https://github.com/omz/Pythonista-Issues/issues/206

You can enable folding, then manually fold ranges, though it is not very automated.

yjq01

It s*cks. I don't think it is convenient at all.
But anyway, thanks a lot.

yjq01

@omz I can pay no matter how much money for this feature.

yjq01

@omz plz

yjq01

Why not?

JonB

I could imagine cold folding could be tricky with out an external keyboard on a small device. I have been playing around with the hidden code folding, and that's what I have been finding... No room for a button that is re reliable yet unobtrusive... You are aware of the "outline" drop-down if you tap the filename, right? That lets you navigate large files by def/clase.

yjq01

@JonB I just want the same naive feature as the IDE like VS code and pycharm on PC. I don’t need to control where should I begin and end the code-folding. Just fold the whole class or def or if or while.

JonB

what i mean is, where do you put the fold/unfold button, so that it is both reliable and unobtrusive. tiny screens and fat fingers are not the same as precise mouse clicks.

yjq01

@JonB Fortunitly, I have the apple pencil.

yjq01

lol so no one cares? All of u just write helloworld.py?