Find / Replace

joe_brig

Member²
Find and Replace does not work correctly,
or it works in a non-standard way.

If I have "1212" selected and "replace" 1
with 2 the result is "2". It should be "2222" or
"2212" if it is to replace only one.

If I have text selected the global option should not be on, the selected button should be the defualt.

After changing text in a selection, the selection should stay selected, this allows multiple changes to the selection.

Right now I have to cut/paste to Word to make find/replace changes.

Thanks.
 
The Replace button will replace ths currently selected text by the replacement text.

To replace all occurrences of a word within the selected text, first make the selection, invoke the Find function, choose "Selected text" as the scope (should already be chosen by default), enter the search and replacement words, and press the "Replace all" button.
 
If I have text selected and make a change the text should still be selected after the change.

Can you put this in as a bug or an enhancement?
 
I'm not quite sure what you mean. When you start the find & replace process and use the current selection as a scope, the subsequent "find" occurrences will override this selection.

Perhaps you wish to restore the selection after using the find & replace function?
 
If I have 2 lines highlighted/selected and make a find/replace change, PL/SQL Dev unselects the 2 lines.

After a change the 2 lines should still be selected, so I can make more changes without reselecting the 2 lines.
 
That's funny, I never noticed that 'global' was marked whenever you make a selection and do a find & replace. I wonder how many times I've made a global change when I hadn't intended to?

But as long as we're on the topic, when doing a find and replace, the cursor moves to the end of the selection, meaning that if I do another find and replace, I have to change the direction from forward to backward. Is there any chance we can get the cursor to stay where it was before the replace?

Although I think keeping the selected area selected would probably fix this issue.
 
To toss in another opinion, I wouldn't necessarily want the original selection still selected after the replace. I can see you wanting to keep your place and maybe that should be an option on the Find dialog, but please don't make it the only behavior.

While we're talking about Find / Replace, I'm a little confused.

If I want to rename my existing function (and all references to it) from 'update_new_parents' to 'update_new_par', I would expect to do this task as follows:

  1. Go to the first occurrence of 'update_new_parents'
  2. Double-click to select the phrase
  3. Open Find dialog (Ctrl-F), to see that the phrase is entered in the Text to Find field, Direction is Forward and Scope is Global.
  4. Type 'update_new_par' in the Replace With field
  5. Press Alt-A to Replace All

But when I look back at the code, that first occurrence I selected via double-click doesn't get replaced. The subsequent occurrences do, but not the first. Am I hallucinating or should I not expect it to work this way? I remember SQL/Navigator worked this way for one maintenance release until they fixed it (and broke something else in Find/Replace...).

Lastly, I looked for Help for both Find and Replace but didn't find anything that described how they're supposed to work. Frankly I'm not sure I understand what Replace is supposed to do, not showing a dialog box at all.

Hints please?

Thanks,

Stew
 
But when I look back at the code, that first occurrence I selected via double-click doesn't get replaced.
That is correct. The cursor is located after the occurrence you selected.
Lastly, I looked for Help for both Find and Replace but didn't find anything that described how they're supposed to work. Frankly I'm not sure I understand what Replace is supposed to do, not showing a dialog box at all.
We'll add something to the documentation. You're not the first to ask.

The Replace menu item replaces the currently selected text by the most recently used replacement text.
 
We just bought a 5-user license and I was showing my teammates some editing, including Find/Replace.

They thought this method that you want to document was counter-intuitive. I heard grumbling like "I guess I'll stick to my current editor!".

All other editors I've worked with do Find/Replace would replace all occurrences of the text to the bottom of the file, INCLUDING the occurence that's selected.

Is there any chance of at least making this a preference or an option on the Find/Replace dialog?

Thanks,

Stew
 
Back
Top