When agreeing to wrap-around, but nothing is found, keep the cursor where it originally was.

Now this is coherent with Advanced F&R.
This commit is contained in:
Tommaso Cucinotta 2013-07-22 23:55:43 +01:00
parent 7081fed380
commit b32ce2cf08

View File

@ -125,6 +125,9 @@ void GuiSearch::wrap_dispatch(const FuncRequest & func, bool forward) {
BufferView * bv = const_cast<BufferView *>(bufferview());
GuiView & lv = *const_cast<GuiView *>(&lyxview());
DocIterator cur_orig(bv->cursor());
if (!bv->cursor().result().dispatched()) {
docstring q;
if (forward)
@ -148,6 +151,7 @@ void GuiSearch::wrap_dispatch(const FuncRequest & func, bool forward) {
if (bv->cursor().result().dispatched())
return;
}
bv->cursor().setCursor(cur_orig);
lv.message(_("String not found."));
}
}