Home Download Buy Blog Forum Support

After find-and-replace, return to start/last replacement

After find-and-replace, return to start/last replacement

Postby DSHugo on Wed Jun 27, 2012 10:03 pm

Hello. I've got a common usage scenario of the find-replace dialog, which is not entirely convenient and/or correct, so I would like to adjust and improve it.

Suppose I have a python file with a class and several methods within. When I want to rename some variable in one of the methods, I invoke "Replace" command, type in the search string and the substitute, and hit Replace button a few times. Since I only need to replace the variable within one method only, I stop at some point, usually when I reach another method. Now, how do I return to the position of the last replacement, or, ideally, to the position from which I started the replacements from? If i hit Undo, I do return to the last replacement, but it is undone, and I have to re-edit it. Also, it would be great if it wasn't python specific, and would work with, say, regular text or css.
DSHugo
 
Posts: 42
Joined: Tue Sep 20, 2011 11:05 am

Re: After find-and-replace, return to start/last replacement

Postby agibsonsw on Wed Jun 27, 2012 10:18 pm

If you press BackSpace to delete the Find term, does it return to the most recently replaced text?

There is also the Find menu/ Use Selection for Replace which might prove helpful. That is, highlight the method text before using Replace.
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.
agibsonsw
 
Posts: 901
Joined: Fri Jan 27, 2012 9:11 pm

Re: After find-and-replace, return to start/last replacement

Postby DSHugo on Thu Jun 28, 2012 5:21 am

Thank you, deleting the find term does indeed put me back to where the caret was before I started the replacements, which is perfect (or so it seems). It is a bit cumbersome, though, but good enough. Pre-selecting the whole method would be inconvenient in my case, because my code often doesn't fit in one screen, and repeated selecting with either mouse or keyboard would be a pain.
DSHugo
 
Posts: 42
Joined: Tue Sep 20, 2011 11:05 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot] and 17 guests