Forum > Editor

Search/Replace

<< < (2/2)

wp:

--- Quote from: MikeFinch on September 07, 2021, 07:15:43 am ---I tried to rename a variable by using Search/Replace in the Global state.

--- End quote ---
I would never do it this way because Search/Replace, even when set to "Global", operates only on the currently selected unit, but an identifier can exist also in other units or in the lfm file. And Search/Replace is "stupid". As Bart already noted, the better option is to use the "Refactoring" > "Rename Identifier" item in the context menu. This is really an amazing feature!

Martin_fr:
1) How to reproduce?

2) Search/replace is current file only (ever if global). "Find in files" has a replace across several files.

3) Global, for the current file. Make sure to also change the origin to "begin of text" or to "wrap around"

Rename Identifier is a different behaviour.

Say you have a variable FFoo in 2 different classes. Rename Identifier will work out to which class each occurrence of FFoo belongs, and only replaces those that belong to the class you selected (when starting rename identifier). So it is a "smart" replace.

Navigation

[0] Message Index

[*] Previous page

Go to full version