Bug in version 14: Find & Replace replaces Find text when marking text in code

Claus Pedersen

Member³
Steps to reproduce:

I open Find & Replace.

I type 'abc' in the 'Text to find' field and go to my code and mark 'xyz' code to eventually copy-paste into the 'Replace with' field.
But now 'abc' is changed into 'xyz' in the dialog and if I am not attentive, I could end up searching and replacing using the wrong text.

Even if the cursor is placed in the 'Replace with' field, it is still the text in 'Text to find' that is replaced when I mark text.

In the manual it is stated: "The Text to find field will initially contain the word or selection at the cursor position when Ctrl-F was pressed."

It does not mention that the content of 'Text to find' could be replaced when marking new text?

Please correct this back to the behavior in version 13.

I am using version 14.0.0.1961
 
From the 14.0.2 release notes: "Find & Replace no longer overrides previously entered search text when selecting text in the editor"
I assume that this correction refers to this thread.
As far as I can see, nothing has changed. In the current version 14.0.2.1969 the behavior is still as described in the original post from June.
 
This enhancement does indeed apply to the issue from this thread:

I type 'abc' in the 'Text to find' field and go to my code and mark 'xyz' code to eventually copy-paste into the 'Replace with' field.
But now 'abc' is changed into 'xyz' in the dialog and if I am not attentive, I could end up searching and replacing using the wrong text.

In version 14.0.2 this no longer occurs when I try it. Can you verify?
 
As I wrote in the post from 27.08.2020, I have upgraded to version 14.0.2.1969 (64 bit) and am still experiencing the problem. As far as I can see, the problem is not solved and works (nearly) as described in the original post:
In an editor (e.g. SQL window or program window), I have the text abc xyz. The cursor is at the start of the line.
I press Ctrl-F to open Find&Replace dialog. The text abc is already present in 'Text to find'.
I place the cursor in 'Replace with' and mark xyz in the code (to eventually copy-paste it into Replace field) by left-dragging the mouse. Now the text in the 'Text to find' field is replaced with the text I am marking.

It seems, that if I enter some text manually in the 'Text to find' field, it is not replaced. But if I mark some text, press Ctrl-F, and mark some other text to replace, then the text in 'Text to find' is replaced.

If requested, I can send you a video to demonstrate.
 
I can't confirm this on 14.0.2.1969 (64bit).

Reproducing this from scratch according to you latest description, after Ctrl+F "abc" is not present in Text to find. In my experience (which I first considered another bug, too) the Find & Replace stuff is heavily dependent on what happened in there before, potentially taking previous values into account.

The behavior also sometimes confuses me, but as far as I observed it, it's finally consistent in a way.
 
Strange. If I write the text
Code:
abc xyz
in an SQL window and place the cursor on line 1, position 1 (before abc) and press Ctrl-F, the Find&Replace dialog is always opened with 'Text to find' prefilled with abc. I have tried to search for another text string, then close PLD and reopen it and start from scratch with a new sql window, and the same thing happens.

If I place the cursor on position 5 (before xyz), and press Ctrl-F, the text xyz is filled in as default in the dialog.

And the prefilled text is always replaced by whatever I am marking in the text.

If I explicitly type something else in the field 'Text to find', it is not replaced when I mark text, only the initial, default text is replaced.

Could it be that I have some kind of default setting for the Find%Replace dialog?
 
Sorry, I have to revoke my last post. I retried it, and can confirm this now. Don't know at what precondition or step my initial try diverged from the description.
 
Back
Top