(i was sure there was an open report already, but i couldn't find it, so here goes)
REPRODUCTION
- FIRST ISSUE
- open https://en.wikipedia.org/wiki/Paris?action=edit
- in toolbar, click "advance" and then click the "search and replace" icon
- "Search for" => france; "Replace with" => schmance
- hit "Replace"
- notice that editor added "schmance" before any other character in edit box
- SECOND ISSUE
- without closing the s&r form, hit "Replace" couple more times. notice that it executed correct replacements
- now click inside the textarea somewhere (*not* just-before-the-f of the word "France")
- hit "Replace" in the s&r box again: notice that it adds "schmance" at the caret location
- rinse and repeat
so the s&r "Replace" does something-other-than-what-you-want-it-to-do when there is no caret in the edit box at all, and when the caret is anywhere except in front of the search word. it seems that the way to make it work as advertised is to hit "Find" first and then "Replace", without moving the caret. this is not the expected pattern, and not the way s&r behaves on any text editor i ever used.
if this issue is already reported (which is what i remembered), please mark as "duplicate".
peace.