Replace when cursor is on last instance

Unexpected results happen when the last instance of a search term has been found and replaced in Advmemo. To reproduce: Connect an Advmemo, advmemofindreplacedialog and advreplacedialog to each other. Enter the following:

dog

Execute the find/replace dialog. In the Find field enter: dog
In the Replace field enter: cat

Click replace twice. As expected, the memo now contains: dogcat
Click replace several more times and you will see something like: dogcatcatcat

The problem appears to be that the search wraps to the beginning of the file such that it is repeatedly finding the single instance of dog and replacing dog with dogcat. 


I have retested this and I cannot reproduce this problem with the latest version.

I have tested this with both "wrap at end" on and off, with caret at different positions.