[wingide-users] Replace in selection

Michael Hipp Michael at Hipp.com
Wed Mar 15 11:43:25 EST 2006


Did this "Replace in selection" feature make it into 2.1b1? I'm not seeing it.

If not, could I put in a heartfelt vote for it? (It's about the one and only 
thing I have to fire up another editor for.)

Thanks,
Michael

Wingware Support wrote:
> Gigi wrote:
>> One thing that bothered me in WingIDE is that it is not possible to
>> perform replace in the selected test only. This is the most useful
>> mode IMO and it's the default in many IDEs. I noticed a thread from
>> April 2005 (search/replace revisited...again) that addresses the same
>> problem. Well, luckilly WingIDe is scriptable and it turned out that
>> is is pretty simple to extend it to support replace in selection.
> 
> Thanks!  It works as advertised after fixing one typo in the script. 
> The replace_in_selection function should be:
> 
> def replace_in_selection(what, with_what):
>    """Replaces 'what' with 'with_what' in the current selection only"""
>    def transform(text):
>      return text.replace(what, with_what)
>    app = wingapi.gApplication
>    editor = app.GetActiveEditor()
>    _transform_selection(editor, transform)
> 
> We still intend to add this functionality to the builtin search and 
> replace tools.
> 
> John
> _________________________________________________
> Wing IDE users list
> http://wingware.com/lists/wingide



More information about the wingide-users mailing list