Help!
Some of the TextPad users in my office have brought the following bug to my attention.
If you do a simple Replace and decide to hit the "Replace Next" button to test your replace (assuming that this button is different from the "Replace" button because it is going to "Find" the next hit and then "Replace" it) then instead TextPad will simply insert the Replacement characters at the caret.
I've never run into this bug becuause, personally, I wouldn't test a Search and Replace like that. I'd find an instance and then use the "Replace" button.
So -- two questions:
A - what is "Replace Next" REALLY supposed to do?
B - does anybody else feel like this is a dangerous bug (there are lots of ways for this bug to bite you i.e. you could be in the middle of Replacing and then move your cursor and then resume with Replace next and whatever was highlighted or wherever your cursor was gets the Replacement Text inserted regardless of matching the Search text!)
--Doug Bayless
2@byu.edu
Replace Next inserts extraneous characters
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
Re: Replace Next inserts extraneous characters
It looks like the Replace button replaces the current selection with whatever is in the Replacement box.
The Replace Next button does the same and then jumps to the next occurrence of what is in the Find box.
If the replacement box contains things like \1..., these are used verbatim!
(Of course, as no find has taken place, Textpad would not know what to substitute for these things)
Seems like a bug to me - Replace/Replace Next should be disabled till a Find was done.
I never noticed this behaviour before because I either use Replace All or start with Find button (to check whether my RegEx does what it is supposed to do)
Andreas
The Replace Next button does the same and then jumps to the next occurrence of what is in the Find box.
If the replacement box contains things like \1..., these are used verbatim!
(Of course, as no find has taken place, Textpad would not know what to substitute for these things)
Seems like a bug to me - Replace/Replace Next should be disabled till a Find was done.
I never noticed this behaviour before because I either use Replace All or start with Find button (to check whether my RegEx does what it is supposed to do)
Andreas
Re: Replace Next inserts extraneous characters
I wouldn't call it a bug. I'd call it undesirable behavior. Here's the text from the help documentation, under "How to Replace Text":
----------------------------------------
b) Click Replace to replace the current selection.
c) Click Replace Next to replace the current selection, and find the next occurrence.
----------------------------------------
So it seems that this has been with us for a long, long time. I agree it's not the ideal (replace should only affect searched-for text, not the currently selected text), and it has left me confused at times, but I personally don't consider it a critical issue.
----------------------------------------
b) Click Replace to replace the current selection.
c) Click Replace Next to replace the current selection, and find the next occurrence.
----------------------------------------
So it seems that this has been with us for a long, long time. I agree it's not the ideal (replace should only affect searched-for text, not the currently selected text), and it has left me confused at times, but I personally don't consider it a critical issue.