1
$\begingroup$

Well I'm not sure this is a good question for this site, but after reading the FAQ section it appears to be OK, so ...

The question is related to the interface and not to computation difficulties. I'm trying to make a panel full of rows and columns and such, but it's getting quite messy to keep track of all the brackets. Is there something in the interface where I can collapse cells wrapped by matching brackets?

$\endgroup$
  • $\begingroup$ Do you already know the multi-click fonctionality ? : when you click several times on a symbol, it extends the selection according to matching brackets. You can also multi-click a simple bracket. $\endgroup$ – andre314 Mar 1 '13 at 12:33
  • $\begingroup$ @andre I never noticed it and it's definitely useful but something like what Netbeans does in java or c (this are the ones I know) would be outstanding and very efficient. $\endgroup$ – PML Mar 1 '13 at 12:47
  • $\begingroup$ Do you mean collapsing of the vertical brackets / cell groupings on the rhs of a notebook? $\endgroup$ – Yves Klett Mar 1 '13 at 13:05
  • $\begingroup$ @YvesKlett Yes something like that. But if I understand it right I would loose the indentations and I don't know how to cell group inside a unique large cell in order to evaluate all the inner cells as a continuous code...Is there a way to do that? $\endgroup$ – PML Mar 1 '13 at 13:12
4
$\begingroup$

This functionality is simply not available in the Front End. I doubt that as a user it's possible to implement practical and usable code folding in the front end. WRI would have to add it.

Some text editors do have this functionality though:

The Wolfram Workbench can fold functions, but not parts of functions.

enter image description here

Sublime Text supports indent based folding (i.e. it's not based on the brackets).

enter image description here

You may want to use these for working on large functions or packages.

Alternative solutions for keeping track of brackets are using bracket highlighting (new in version 9), Edit -> Check Balance (Shift-Command-B) and Edit -> Extend Selection (Control-.).

| improve this answer | |
$\endgroup$
  • $\begingroup$ Well it's a shame that it's not implemented in eclipse. The brackets highlighting is certainly a nice improvement but could go a little further. Thank you for you very complete answer. $\endgroup$ – PML Mar 1 '13 at 18:20
  • $\begingroup$ We should ask WRI to implement it!!!! $\endgroup$ – ivbc Jun 17 '16 at 20:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.