Clear the selection if we didn't find the searchstring (fix #310).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3980 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Vigna 2002-04-12 09:02:21 +00:00
parent 2588a92167
commit 9b6fc7b6c9
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,7 @@
2002-04-12 Juergen Vigna <jug@sad.it> 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 * text2.C (insertInset): freeze Undo after setUndo so that it is not
again called in insertChar(). again called in insertChar().

View File

@ -176,9 +176,12 @@ bool LyXFind(BufferView * bv,
bv->getLyXText()->setSelectionOverString(bv, searchstr); bv->getLyXText()->setSelectionOverString(bv, searchstr);
bv->toggleSelection(false); bv->toggleSelection(false);
bv->update(bv->getLyXText(), BufferView::SELECT|BufferView::FITCUR); 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; found = false;
}
if (bv->focus()) if (bv->focus())
bv->showCursor(); bv->showCursor();