[Lazarus] working with editor in column mode in Lazarus

Martin Frb lazarus at mfriebe.de
Fri Nov 7 13:48:31 CET 2014


On 07/11/2014 10:10, duilio foschi wrote:
> 1. I select some text in column mode:
...
> while I would expect ALL occurences in the selected area be changed.
...
> I want to copy the equal sign in all the following lines at the same column
> (this is something I do all the time in Delphi).
...
> When in column mode, Delphi positions the cursor in the next line
> after the replace is done.
>
> Lazarus does not this and I have to move the cursor to the next line
> myself for all the intended replacements.
>
Unfortunately neither is implemented.

1) Some editors create a multi-line caret, when a blockselection is 
made, and then any typing acts at all the lines (some editors even allow 
you to place several carets in random locations). That is on the TODO, 
but no timeframe when....

2) I remember, I once saw this, that after you edited  in one line, and 
pressed caret down, the x pos would be restored, I am not sure on the 
conditions that trigger it.

The 2nd can be emulated using macros 
http://wiki.lazarus.freepascal.org/Editor_Macros_PascalScript and a 
bookmark.

Define the macro, and assign to a key.

var i: integer;
begin
   i := caller.carety;
   ecGotoMarker1;
   caller.carety := i;
   ecSetMarker1;
   ecDown;
end.

First set the bookmark where you start.
The after typing/pasting, press the key for the macro. IT will go to the 
bookmark column, and one down.

It is not the same as the build in functionality, but it may be the best 
workaround for now.





More information about the Lazarus mailing list