]> git.lyx.org Git - features.git/commitdiff
find: give status message when auto-wrapping
authorScott Kostyshak <skostysh@lyx.org>
Wed, 2 Jun 2021 03:59:50 +0000 (23:59 -0400)
committerScott Kostyshak <skostysh@lyx.org>
Fri, 16 Jul 2021 19:50:30 +0000 (15:50 -0400)
When auto-wrap is enabled, it is sometimes informative to know
when the search wraps.

A status message is consistent with LibreOffice and Vim.

src/lyxfind.cpp

index 1760c94384ead028602d481fcf791e9e0041b5ff..004e10b51ed043fc4423f87d861ee8c7e78a3ce6 100644 (file)
@@ -359,6 +359,12 @@ bool findOne(BufferView * bv, docstring const & searchstr,
                                bv->cursor().setCursor(doc_iterator_end(&bv->buffer()));
                                bv->cursor().backwardPos();
                        }
+                       if (auto_wrap) {
+                               docstring const msg = forward
+                                 ? _("Search reached end of document, continuing from beginning.")
+                                 : _("Search reached beginning of document, continuing from end.");
+                               bv->message(msg);
+                       }
                        bv->clearSelection();
                        if (findOne(bv, searchstr, case_sens, whole, forward,
                                    find_del, false, false, false, false))