Indentation-based approach to folding is not effective #568
Labels
topic: infrastructure
Related to project infrastructure
type: imperfection
Perceived defect in any part of project
Describe the problem
The IDE's code folding system assumes that code blocks will always be indented, and that indented text is always a code block.
🐛 This not a valid assumption. As a result, some code blocks are not foldable, some don't fold correctly, and some things fold that should not.
To reproduce
Open a sketch that contains code with structure not reflected by indentation:
Hover the mouse pointer up and down through the left margin of the editor pane in the IDE. Noting the locations of the fold controls.
Do a "Fold All". Note the results.
Expected behavior
Folding occurs based on code structure, independent from indentation.
Arduino IDE version
Original report
2.0.0-beta.12-nightly.20211021
Last verified with
63e9dfd
Operating system
Windows
Operating system version
Additional context
Previously reported at arduino/arduino-pro-ide#13 and claimed to be fixed at that time, so perhaps a regression.
Folding is more reliable in the Arduino IDE 1.x:
Additional reports
Issue checklist
The text was updated successfully, but these errors were encountered: