Re: bug in TextFinder.m (also in TextEdit)
Re: bug in TextFinder.m (also in TextEdit)
- Subject: Re: bug in TextFinder.m (also in TextEdit)
- From: "John C. Randolph" <email@hidden>
- Date: Wed, 22 Aug 2001 12:31:14 -0700
On Wednesday, August 22, 2001, at 11:48 AM, Oliver Chern wrote:
I'm not quite sure if this is the right listserver to send to, but since
I've seen Ali Ozer post a couple times here and I'm sure a couple ppl
have
used Textfinder.h and textfinder.m in their source code, I figured I
should
point out this bug here.
when a user clicks replace, and then replace & next, he gets an unwanted
duplicate of the replace string.
Example:
asdf
asdf
Find: asdf
Replace With: zako
1. click "next" to find the search string "asdf".
2. click "replace" to replace "asdf" with "zako".
3. click "replace and find" with the same search strings.
u'll end up with:
zakozako
asdf
just thought u'd like to know.
The bug there isn't in the behaviour of the code, it's in the confusing
title of the button. "Replace" inserts the replacement string in place
of the current selection. After step 2, the selection is right after
the string you inserted, and it has zero length. To get the behaviour
you want, don't use the "replace" button, just use the "replace and
find."
-jcr
[Objc retain];