]> git.lyx.org Git - features.git/commitdiff
Nearly cosmetics.
authorTommaso Cucinotta <tommaso@lyx.org>
Sat, 16 Apr 2011 10:48:55 +0000 (10:48 +0000)
committerTommaso Cucinotta <tommaso@lyx.org>
Sat, 16 Apr 2011 10:48:55 +0000 (10:48 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38410 a592a061-630c-0410-9148-cb99ea01b6c8

src/lyxfind.cpp

index 02dc9ff07b48058db08eee105742ca76506e2956..22e3b71f8f33aee94ae472eef9b32d4521d2f6c2 100644 (file)
@@ -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);