Fix of #4388 also for non advanced find.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37047 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Tommaso Cucinotta 2010-12-30 15:34:09 +00:00
parent e82fd0c4a3
commit fa0e638b95

View File

@ -270,6 +270,13 @@ pair<bool, int> replaceOne(BufferView * bv, docstring searchstr,
return pair<bool, int>(false, 0); return pair<bool, int>(false, 0);
cap::replaceSelectionWithString(cur, replacestr, forward); 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); findOne(bv, searchstr, case_sens, whole, forward, false);
return pair<bool, int>(true, 1); return pair<bool, int>(true, 1);