From: Tommaso Cucinotta Date: Sat, 16 Apr 2011 10:48:55 +0000 (+0000) Subject: Nearly cosmetics. X-Git-Tag: 2.0.0~104 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=8fd08e4ecebd37e25b6c5a04e47f33e3a99eeef8;p=features.git Nearly cosmetics. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38410 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 02dc9ff07b..22e3b71f8f 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -1337,8 +1337,9 @@ static void findAdvReplace(BufferView * bv, FindAndReplaceOptions const & opt, M LYXERR(Debug::FIND, "Replacing by niceInsert()ing latex: '" << repl_latex << "'"); sel_len = cur.niceInsert(repl_latex); } - cur.pos() -= sel_len; - if (cur.pos() < 0) + if (cur.pos() >= sel_len) + cur.pos() -= sel_len; + else cur.pos() = 0; LYXERR(Debug::FIND, "Putting selection at cur=" << cur << " with len: " << sel_len); bv->putSelectionAt(DocIterator(cur), sel_len, !opt.forward);