From: Tommaso Cucinotta Date: Mon, 22 Jul 2013 22:55:43 +0000 (+0100) Subject: When agreeing to wrap-around, but nothing is found, keep the cursor where it original... X-Git-Tag: 2.1.0beta2~220 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=b32ce2cf085ec90b59ae9909a5b89853271038a3;p=features.git When agreeing to wrap-around, but nothing is found, keep the cursor where it originally was. Now this is coherent with Advanced F&R. --- diff --git a/src/frontends/qt4/GuiSearch.cpp b/src/frontends/qt4/GuiSearch.cpp index 295bf42e4f..aa72fa8744 100644 --- a/src/frontends/qt4/GuiSearch.cpp +++ b/src/frontends/qt4/GuiSearch.cpp @@ -125,6 +125,9 @@ void GuiSearch::wrap_dispatch(const FuncRequest & func, bool forward) { BufferView * bv = const_cast(bufferview()); GuiView & lv = *const_cast(&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.")); } }