Find./replace behavior

15 Feb 2011

Find/replace shows the following behavior when searching for repeated sub-strings in a simple test program:

int main() {
    printf("findme1, findme2, findme3, findme4\n");
    prinft("findme5, findme6, findme7, findme8\n");
    }
}
  • Enter “findme” in the "Find:" text box, click the "Find" button repeatedly. This finds the 8 successive instances in order. Works as expected.
  • Enter “findme” in the "Find:" text box, enter “foundme” in the "Replace" text box, click the "Replace" button repeatedly. The text is replaced in the following sequence findme1, findme3, findme5, findme7, findme2, findme6, findme 4, findme 8. In other words, find/replace does not replace successive entries on the same line; rather it skips every other instance on a given line, or alternates replacements between lines. Does not work as expected.
  • It is not possible work around this by first clicking "Find", then click "Replace" - after the first replacement the search engine skips the next occurrence.

This behavior makes "Replace" difficult to use in large files where some target text strings may occur in many places besides the intended line or two.

While investigating this bug, perhaps you could also consider an enhancement: allow the user to select (via highlighting) the desired range of text in which find/replace will operate. I find this very useful in other editors.

17 Feb 2011

Logged. Thanks hexley!

17 Feb 2011

Heh yeah that bug showed up after the last find/replace bug was fixed. Gotta love programming lol. Fix one problem, create two.

16 Mar 2011

I don't see this in the bug tracker. Any update on an expected fix date?

Tnx - hb

17 Mar 2011

I've seen that bug too. Just hit replace 2 or 3 times till all replacements are done. More bothering is: 'replace' is not confined to a selection (afaik). When navigating to another file, the 'find' box is cleared. I could surely use a project-level grep.

Ad

16 Jun 2011

Should be fixed in beta

16 Jun 2011

Verified. This is great.

16 Jun 2011

Find in Program is also in development on our dev site btw.