Navigating a large classdef in the editor?

Many (most?) programmer's editors will produce an interactive index or TOC of a program file that has many components (like MATLAB's classdefs, which can have many individual functions).
I find myself returning to my favorite programmer's editor (Textmate) for just this reason. Even if I order a class's methods alphabetically by name inside the classdef, I find myself spending an inordinate about of time navigating from method to method while editing.
Is there a TOC or index hidden in some editor feature I haven't discovered yet? Given that the editor does all the syntax analysis that it does, it should be easy to provide a clickable list of methods, instance variables, etc. (in a dropdown list, for example) to allow easier navigation of a large classdef.

Respuestas (3)

Matt Tearle
Matt Tearle el 30 de Mzo. de 2011

1 voto

In the Editor toolbar there is a button that looks like a blue "f()". If you hover over it, it says "show functions". If you click on it, you get a dropdown of all the functions/methods in that file. Is that what you're after?
Steve Beisner
Steve Beisner el 30 de Mzo. de 2011

0 votos

Exactly what I was looking for... thanks for helping a newcomer.
David Young
David Young el 30 de Mzo. de 2011

0 votos

I find the code wrapping in the editor very helpful too - when classdef files get big, I keep the methods compressed and expand them when I want to look at them.

2 comentarios

Matt Tearle
Matt Tearle el 30 de Mzo. de 2011
Yes, I was thinking I should mention that, too. Handy key shortcut: <ctrl><=> (or right-click and select "code folding" -> "fold all"
Diego
Diego el 3 de Jul. de 2013
Every time I want to "Fold all", I need to do it with mouse right-click, because ctrl<=> doesn't work. But I would like to use ctrl<=>! Any idea why is it not working?

Iniciar sesión para comentar.

Categorías

Más información sobre Scripts en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 30 de Mzo. de 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by