New submission from George Zhang <geetran...@gmail.com>:

Congrats on adding line numbers to IDLE.

With this change, a change to add code folding could be done more easily as the 
folding can reference the line numbers. Many other IDEs have code folding but 
IDLE should also have it.

Code folding could be done with a +/- to the right of the line numbers and can 
show/hide the indented suite under the header (compound statements). It should 
use indentation as tool to figure out which parts can be folded. Blank lines 
don't count. Single line compound statements cannot be folded.

Something like this:

1  - | def spam(ham):
2  - |     if ham:
3    |         eggs()
4    | 
5  + | def frob():
8    | 
9  - | FOO = (
10   |     1, 2, 3, 4,
11   |     5, 6, 7, 8,
12   | )
13   | 
14   | BAR = (
17   | )
18   | 
19   | if True: print("True")
20   |

----------
assignee: terry.reedy
components: IDLE
messages: 349922
nosy: GeeVye, terry.reedy
priority: normal
severity: normal
status: open
title: Code folding in IDLE
versions: Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37882>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to