+2001-09-07 Angus Leeming <a.leeming@ic.ac.uk>
+
+ * ControlSearch (replace): change semantics of replace to NOT move on
+ to the next instance of a word once the present instance has been
+ replaced unless we are replacing ALL instances of the word.
+
2001-09-07 Rob Lahaye <lahaye@users.sourceforge.net>
* ControlButtons.[Ch]: added publicly accessible IconifyWithMain method.
void ControlSearch::replace(string const & search, string const & replace,
bool casesensitive, bool matchword, bool all) const
{
+ // If not replacing all instances of the word, then do not
+ // move on to the next instance once the present instance has been
+ // changed
+ bool const once = !all;
int const replace_count = LyXReplace(lv_.view(),
search, replace, true, casesensitive,
- matchword, all);
+ matchword, all, once);
if (replace_count == 0) {
setMinibuffer(&lv_, _("String not found!"));