]> git.lyx.org Git - features.git/commitdiff
When agreeing to wrap-around, but nothing is found, keep the cursor where it original...
authorTommaso Cucinotta <tommaso@lyx.org>
Mon, 22 Jul 2013 22:55:43 +0000 (23:55 +0100)
committerTommaso Cucinotta <tommaso@lyx.org>
Mon, 22 Jul 2013 22:55:43 +0000 (23:55 +0100)
Now this is coherent with Advanced F&R.

src/frontends/qt4/GuiSearch.cpp

index 295bf42e4fc856f0997eb5a2e6b8959fb4226a75..aa72fa874440c9ef365fd6483fada78d3e99a39a 100644 (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."));
        }
 }