Home Download Buy Blog Forum Support

window.showReplacePanel()

window.showReplacePanel()

Postby FalconNL on Thu Jun 10, 2010 8:37 am

window currently has functions for showing the quick panel and the input panel with prefilled text. I would like to request adding a function to show the replace panel (and logically, the file panel as well, but I'm mainly interested in the former), with arguments indicating which options (regex, case-sensitive, etc.) should be turned on or off, initial text for the pattern and replace field, and which of those two the cursor starts in.

The use case for this is adding a poor man's 'rename identifier' feature. Position cursor over identifier, hit the keyboard shortcut, show the replace panel with a pattern of (?<=\b)identifier(?=\b) and regex turned on, type new name and hit replace all, with the advantage of being able to preview the changes. We of course already have the findUnder command which is similar, but this does not take into account word boundaries, meaning that, for example, renaming the variable 'ring' to 'circle' will replace all your string types with the non-existent stcircles.
FalconNL
 
Posts: 67
Joined: Thu May 29, 2008 8:17 pm

Re: window.showReplacePanel()

Postby GreyWyvern on Thu Jun 10, 2010 3:35 pm

Might be useful to attach something like this to Shift+Alt+F3, because it's similar to Alt+F3, just taking into account word boundaries.
GreyWyvern
 
Posts: 106
Joined: Fri Oct 23, 2009 7:08 pm
Location: Canadia

Re: window.showReplacePanel()

Postby FalconNL on Thu Jun 10, 2010 4:23 pm

I was thinking ctrl+r, but to each his own keybindings :)
FalconNL
 
Posts: 67
Joined: Thu May 29, 2008 8:17 pm


Return to Ideas and Feature Requests

Who is online

Users browsing this forum: No registered users and 16 guests