From fb37682d7454f2679d01235ad51912fe11d6caa6 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 6 Feb 2023 11:47:14 +0100 Subject: [PATCH] Check whether we have a selection before issuing warning (#12655) --- src/lyxfind.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 39543fa5ad..2ddedcb481 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -333,7 +333,7 @@ bool findOne(BufferView * bv, docstring const & searchstr, 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?"), -- 2.39.5