[Lazarus] ctrl+j rename possible bug

Martin lazarus at mfriebe.de
Wed Dec 9 23:02:41 CET 2009


ik wrote:
> Hello,
>
> I'm using Lazarus 0.9.29 r23051M FPC 2.5.1 x86_64-linux-gtk 2 (beta) .
>
> I selected a whole procedure and used CTRL+J to rename a local 
> variable and it's whole usage in the code like so:
>
> procedure a_test;
> var
>   SelStart : integer;
> begin
>   SelStart := Edit1.SelStart;
> ...
> end;
>
> When I renamed SelStart to OldStart, it also renamed the Edit1.SelStart .
> The expected result is not to touch the property itself.
>
> Can it be configured somehow, or should I report it as a bug ?
You speak of the new "syncro-edit" (select block, then ctrl-j)?

Syncro edit does not interprete the text as pascal. Syncro-edit just 
edits all word's that are the same (as does a normal search replace). 
Therefore what you describe is intended behaviour. their is no 
configuration neither.

What you may be looking for is "refactoring" => "rename identifier". You 
find it in the context menu, or you can assign it your own 
key-short-cut.  "rename identifier". does not require a selection, since 
it finds the variable/identifier name by it's pascal scope.

Martin





More information about the Lazarus mailing list