[Lazarus] Code Explorer synchronized with caret position

Hans-Peter Diettrich DrDiettrich1 at aol.com
Tue Jul 6 16:40:41 CEST 2010


theo schrieb:
> Wouldn't it be useful, if the code explorer had a mode to
> highlight/expand the node which corresponds the current caret-position
> in the source editor? At least in mode "Refresh on Idle" / "Source View".

IMO the code explorer should work (primarily) in the opposite direction, 
as a map from which one can go to the according item in the unit.

> Or is there such an option and I just could not find it?

I'd like an extension to the editor statusbar, where the full unit 
filename is shown - why not append the current procedure or type name there?

> For me, this would be more useful than code-folding.
> - You would know where you are. ;-)
> - You could see neighbour methods, which are probably related with the
> current method.
> - You could see parameters (even if header not visible due to scrolling).
> - You could see var sections (even if var section not visible due to
> scrolling).

IMO such features can become add-ons, which the user can show and dock 
into his preferred position.

> Has this been discussed before? Was it rejected for a reason?

There exist wishes for an splitted editor view, with the declaration (or 
interface) part in one pane, and the implementation in another one. I 
liked that splitted view in VB3 much, 15 years ago, but nowadays I'm not 
so sure.

> Am I right, that the prerequisites for this feature are already there?

Not really, I fear, but it should be possible to add the required 
methods or notifications to the tool interface. The most important 
extension already is in the IDE - multiple independent views of the same 
unit. What's missing is a relationship between editors and other windows 
(Code Explorer...), so that *every* editor window can have its own set 
of such related (docked) windows (as in older Delphi versions). It would 
solve a problem in the current docked layouts, where the visibility 
(top) and focus of e.g. the Messages window and the related editor file 
causes some headaches.

DoDi





More information about the Lazarus mailing list