find: give status message when auto-wrapping

When auto-wrap is enabled, it is sometimes informative to know
when the search wraps.

A status message is consistent with LibreOffice and Vim.
This commit is contained in:
Scott Kostyshak 2021-06-01 23:59:50 -04:00
parent abc65d4700
commit 47b0c33820

View 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))