Interesting test find & replace problem

This feels like a bug, but maybe the Redstone guru’s have a better explanation :slight_smile:

While editing some text in a script, I had to do a find and replace for some text that occurred frequently. The code I was editing was the definition of an array that contained items like SDMPEGIFRAME422, SDMPEGIFRAME420, etc. I wanted to replace MPEG with nothing, so I did a find and replace for SDMPEG with replace set to SD. Typically in OS X apps, you can keep clicking replace, and it will automatically move through each hit in the list and do the replacement.

However, in Eggplant, hitting replace keeps inserting SD at the same point where the first result occurred. That it, it made SDIFRAME422, SDSDIFRAME422, SDSDSDIFRAME422, etc, requiring me to manually click next for each iteration.

Is this a bug, or by design, or ?

It’s not clear if, on the Find panel, you were hitting the “Replace” button or the “Replace and Find” button. When I try similar tests here it works just fine using the later button.

As of Eggplant 3.0 we are using the standard Apple find panel and so it’s behavior should be very consistent with other Cocoa apps.

A slight limitation in the panel is that doing that until it “wraps around” doesn’t provide a “search wrapped” or other notifier when it gets back to the top.

I think you are correct. Thanks for the clarification.

One interesting way of seeing this is to open a blank doc on text edit and try the following:

Find: asd
Replace: xxxx

Hitting “Replace and Find” over and over again will place “xxxx” in the document over and over without the Find text ever being there. This feels wrong to me.

Okay, understood. We may want to add a note in our documentation that points out that “Replace and Find” will replace whatever is currently selected. I notice that in this case it does beep to let you know that the search text was not found again.