Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-11

working with editor in column mode in Lazarus

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

duilio foschi

1. I select some text in column mode:

http://i58.tinypic.com/2d9p5ao.jpg

2. want to replace colon (':') with the equal ('=') char

http://i59.tinypic.com/34dfklf.jpg

3. I see that only the first occurrence of the token was replaced

http://i58.tinypic.com/29ehnaf.jpg

while I would expect ALL occurences in the selected area be changed.

Why ?

4. I copy the equal sign char into the clipboard with CTRL-C

http://i61.tinypic.com/a4sokm.jpg

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).

5. I place the cursor in the next line...
http://i57.tinypic.com/2vwy0zt.jpg

6. ...and press CTRL-V
http://i62.tinypic.com/2ikbiw1.jpg

The pic above shows the position of the cursor after the replace.

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.

Working in column mode this way is a pain the neck.

Or I can configure Lazarus so to get the expected behaviour ?

Thank you

Peppe

Reply by email

Martin Frb
to duilio foschi
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).

...

Show quoted text 6 lines
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.

Reply by email

duilio foschi
to Martin Frb
it may be the best workaround for now

I am switching btw Lazarus and JediEditor.

JediEditor has everything I need.

What a waste of time !

Thank you

Duilio

2014-11-07 13:48 GMT+01:00 Martin Frb :

Show quoted text 61 lines
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. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email