davefarmercsi
15 years agoNew Contributor
Find/Replace not working correctly
Editing a script, I was using the Find/Replace function. I was trying to replace the string MainW with mainWindow. I didn't use the Replace All button (because I didn't want MainWin to become mainWindowin). I would use the Find Next button to find the next instance of MainW, visually verify that I wanted to do the replacement, then click the Replace button. The normal action would be for that instance of MainW to be replaced with mainWindow and the the next instance of MainW found. However, about 15% of the time, clicking the Replace button would do this: the replacement was made incorrectly (and unpredictably), the next instance of MainW was found, with the replacement already made to that instance. (That was my clue that the replacement was done incorrectly: I would be positioned on the next instance of MainW, but it was already changed to mainWindow.) The bad replacement was unpredictable: Sometimes it replaced MainW with nW; sometimes it deleted that and characters after it without inserting anything; etc.
If I undid the erroneous action and tried it again, I'd get the same bad results on that instance. So there must be a reason; it's not a random event. (I did not have Match Case or any of the other option checkboxes checked, in case that helps.)
This happened with multiple find/replace combinations, not just the one in my example. And the error is unpredictable: I've even seen it do multiple replacements from a single click of the Replace button. My only reliable solution is to use the Find to locate the instances and paste in the replacement myself. Major pain when there is supposed to be a simpler, standard way to do this.
Is this a known bug in the editor?
If I undid the erroneous action and tried it again, I'd get the same bad results on that instance. So there must be a reason; it's not a random event. (I did not have Match Case or any of the other option checkboxes checked, in case that helps.)
This happened with multiple find/replace combinations, not just the one in my example. And the error is unpredictable: I've even seen it do multiple replacements from a single click of the Replace button. My only reliable solution is to use the Find to locate the instances and paste in the replacement myself. Major pain when there is supposed to be a simpler, standard way to do this.
Is this a known bug in the editor?