]> git.lyx.org Git - features.git/commitdiff
Check whether we have a selection before issuing warning (#12655)
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 6 Feb 2023 10:47:14 +0000 (11:47 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 6 Feb 2023 10:47:14 +0000 (11:47 +0100)
src/lyxfind.cpp

index 39543fa5ad2556940914b620520c1541e58bce18..2ddedcb4818bf21d37ae1c406fd7de9326990cd5 100644 (file)
@@ -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?"),