Sign in Join

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

Mailing lists / lazarus / 2009-12

ctrl+j rename possible bug

6 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

ik

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 ?

Ido

http://ik.homelinux.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20091209/1b7c7e35/attachment.html>

Reply by email

Vincent Snijders
to ik
ik wrote 20 lines
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 ?

IIRC, such a bg already has been reported.

Vincent

Reply by email

Martin
to ik: I'm using Lazarus 0.9.29 r23051M FPC 2.5.1 x86_64-linux-gtk 2 (beta) . I selected a whole…
ik wrote 19 lines
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

Reply by email

Mattias Gaertner
to ik: I'm using Lazarus 0.9.29 r23051M FPC 2.5.1 x86_64-linux-gtk 2 (beta) . I selected a whole…
Show quoted text 17 lines
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.

Selection+Ctrl+J is syncron edit. It replaces word occurences in selection.
To rename a variable use Ctrl+Shift+E.

Can it be configured somehow, or should I report it as a bug ?

It is by design.

Mattias

Reply by email

Mattias Gaertner
to Vincent Snijders: Found it: http://bugs.freepascal.org/view.php?id=10978 Vincent
Show quoted text 10 lines
Vincent Snijders schreef: >> The expected result is not to touch the property itself. >> >> Can it be configured somehow, or should I report it as a bug ? >> > > IIRC, such a bg already has been reported. > Found it: http://bugs.freepascal.org/view.php?id=10978

Renaming a component does not trigger the rename identifier function. (because of speed and error handling)

Mattias

Reply by email