From b32ce2cf085ec90b59ae9909a5b89853271038a3 Mon Sep 17 00:00:00 2001 From: Tommaso Cucinotta Date: Mon, 22 Jul 2013 23:55:43 +0100 Subject: [PATCH] When agreeing to wrap-around, but nothing is found, keep the cursor where it originally was. Now this is coherent with Advanced F&R. --- src/frontends/qt4/GuiSearch.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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.")); } } -- 2.39.5