Replace in Selected Text problem - Feature Request - I'm begging:)

For some reason IDEA really frustrates me with the way it handles replace in selected text. After you select a portion of text that you want to replace and bring up the replace dialog you can not leave that dialog box to then select a region of text so that you can replace in that region.

Instead you seem to have to select the region you want to replace in BEFORE you try to replace anything - but the problem with this is you lose the ability to select the portion of text that you want to replace and have that automatically appear in the replace box.

Maybe I'm missing a way around this? Considering other editors (jEdit, UltraEdit ) don't operate this way, I'm surprised to not see this replace in selected text handled differently.

2 comments

Here is what I do.

To Replace with within selected area + select and copy + select + invoke replace text ('Text to find:' has initial focus) + paste copied To Replace with within selected area + select and copy + select and copy + select ]]>
+ invoke replace text ('Text to find:' has initial focus)
+ CTRLSHIFTV and select ]]> from the list, hit ENTER
+ TAB to 'Replace with' field
+ CTRLSHIFTV and select ]]> from the list.

I don't find it that onerous once you get the routine down, although Jetbrains could probably make this more intuitive by making the dialog non-modal and then adding a little icon next to the 'Text to find', 'Replace with' and Scope|Selected text. Clicking the selection icon would set the field/scope to the currently selected text. This only works if the dialog is non-modal so you are free to select text.

My main gripe about the Find / Replace / Find in Path / Replace in Path dialogs is they don't support standard editor keymappings like CTRLLEFT_ARROW, CTRLDELETE, Goto Start of Line (CTRLA for me), Goto End of Line (CTRLE for me) while editing the 'Text to find' and 'Replace with' textfields.

See following for recent summary of the open Jira requests for searching/replacing.
http://www.intellij.net/forums/thread.jsp?forum=22&thread=197579&tstart=30&trange=30

0

I agree what you proposed will work, but it's definitely more work and much more annoying in my opinion.

Other editors I've used all let you just select the text you want to replace (no need to copy first).

Select text you want to replace, hit ctrl-R (or whatever the replace command is), then you can leave the dialog and select the area of text, check the "replace in selection" box, hit "replace" - done. Notice there is no need to even have to use "copy" at all.

Basically, yes, the idea would be to make that replace dialog box non-modal.

0

Please sign in to leave a comment.