From fa0e638b955d5ba162fcf1234ab881e4fa1b9d9b Mon Sep 17 00:00:00 2001 From: Tommaso Cucinotta Date: Thu, 30 Dec 2010 15:34:09 +0000 Subject: [PATCH] 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 --- src/lyxfind.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index d292364d97..1750e2f092 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -270,6 +270,13 @@ pair replaceOne(BufferView * bv, docstring searchstr, return pair(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(true, 1); -- 2.39.2