Author: tommaso
Date: Thu Dec 30 16:34:09 2010
New Revision: 37047
URL: http://www.lyx.org/trac/changeset/37047

Log:
Fix of #4388 also for non advanced find.

Modified:
   lyx-devel/trunk/src/lyxfind.cpp

Modified: lyx-devel/trunk/src/lyxfind.cpp
==============================================================================
--- lyx-devel/trunk/src/lyxfind.cpp     Thu Dec 30 09:47:34 2010        (r37046)
+++ lyx-devel/trunk/src/lyxfind.cpp     Thu Dec 30 16:34:09 2010        (r37047)
@@ -270,6 +270,13 @@
                return pair<bool, int>(false, 0);
 
        cap::replaceSelectionWithString(cur, replacestr, forward);
+       if (forward) {
+               cur.pos() += replacestr.length();
+               LASSERT(cur.pos() <= cur.lastpos(), /* */);
+       } else {
+               cur.pos() -= replacestr.length();
+               LASSERT(cur.pos() >= 0, /* */);
+       }
        findOne(bv, searchstr, case_sens, whole, forward, false);
 
        return pair<bool, int>(true, 1);

Reply via email to