From: Stephan Witt Date: Mon, 30 Jul 2012 12:32:29 +0000 (+0200) Subject: Fix the wrong cursor move when forward flag is false: X-Git-Tag: 2.1.0beta1~1623 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=430cf3ee5ef125b8bc610300afca58437b734306;p=features.git Fix the wrong cursor move when forward flag is false: The forward flag is used to place the cursor behind the replaced text if it's true. But it's not correct to move the cursor if it's false. The cursor is in front of the replacement already after the replaceSelectionWithString() was done. --- diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 73f6469754..bd4e04e860 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -275,9 +275,6 @@ pair replaceOne(BufferView * bv, docstring searchstr, if (forward) { cur.pos() += replacestr.length(); LASSERT(cur.pos() <= cur.lastpos(), /* */); - } else { - cur.pos() -= replacestr.length(); - LASSERT(cur.pos() >= 0, /* */); } if (findnext) findOne(bv, searchstr, case_sens, whole, forward, false);