From 430cf3ee5ef125b8bc610300afca58437b734306 Mon Sep 17 00:00:00 2001 From: Stephan Witt Date: Mon, 30 Jul 2012 14:32:29 +0200 Subject: [PATCH] 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. --- src/lyxfind.cpp | 3 --- 1 file changed, 3 deletions(-) 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); -- 2.39.2