if (match_len > 0)
bv->putSelectionAt(cur, match_len, !forward);
- else if (onlysel) {
+ else if (onlysel && bv->cursor().selection()) {
docstring q = _("The search string was not found within the selection.\n"
"Continue search outside?");
int search_answer = frontend::Alert::prompt(_("Search outside selection?"),