ghpython icon indicating copy to clipboard operation
ghpython copied to clipboard

folding code blocks in code editor

Open bengolder opened this issue 13 years ago • 3 comments

In the C# and VB.NET scripting components, it is possible to include functions below the main script, in the editor, and to collapse these code blocks.

It would be really nice to have the ability to collapse blocks of code, so that one could include a large amount of additional functions or classes in a script without compromising readability. This offers an alternative to importing packages.

bengolder avatar Mar 06 '12 13:03 bengolder

Newer versions of Rhino 5 have an improved code folding strategy. Just making a function should make the inner scope properly foldable. Does it help?

piac avatar May 17 '12 21:05 piac

Thanks Giulio, this does help. My only other concern is that fold persistence: if I give someone a ghpython component with folded functions and they open it, will those functions remain folded? I'll test and let you know.

bengolder avatar Jun 13 '12 12:06 bengolder

Hello Ben

it will not remain folded. Folding is usually just an editor help (.py files are simple text). And it does not stick in the _EditPythonScript editor, so it won't stick in the GhPython editor either, sorry. What should the next reader understand from the folding strategy?

piac avatar Jun 13 '12 13:06 piac