]> git.lyx.org Git - features.git/commitdiff
Clear the selection if we didn't find the searchstring (fix #310).
authorJürgen Vigna <jug@sad.it>
Fri, 12 Apr 2002 09:02:21 +0000 (09:02 +0000)
committerJürgen Vigna <jug@sad.it>
Fri, 12 Apr 2002 09:02:21 +0000 (09:02 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3980 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/lyxfind.C

index 5b549f07eea63f686bbe1d1d064fb192fbd56bcd..d29b6640389080496bdecd8d705fccf005c0278b 100644 (file)
@@ -1,5 +1,7 @@
 2002-04-12  Juergen Vigna  <jug@sad.it>
 
+       * lyxfind.C (LyXFind): clear the former selection if not found!
+
        * text2.C (insertInset): freeze Undo after setUndo so that it is not
        again called in insertChar().
 
index fa6acb468fb2962dacf05f498e971a09e53ed288..7e42daca2d64a9abc3f228930cd0437858d1de32 100644 (file)
@@ -176,9 +176,12 @@ bool LyXFind(BufferView * bv,
                bv->getLyXText()->setSelectionOverString(bv, searchstr);
                bv->toggleSelection(false);
                bv->update(bv->getLyXText(), BufferView::SELECT|BufferView::FITCUR);
-       } else if (result == SR_NOT_FOUND)
+       } else if (result == SR_NOT_FOUND) {
+               bv->toggleSelection();
+               bv->getLyXText()->clearSelection();
+               bv->update(bv->getLyXText(), BufferView::SELECT|BufferView::FITCUR);
                found = false;
-
+       }
        if (bv->focus())
                bv->showCursor();