From a4039a1bf839586bb9e7de4f22caded77cb88271 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 9 Jun 2021 21:58:16 +0200 Subject: [PATCH] Macro IDE: Ctrl+F does not enter whole selection into find edit box - just if that's a part of a line and not empty --- src/lay/lay/layMacroEditorPage.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lay/lay/layMacroEditorPage.cc b/src/lay/lay/layMacroEditorPage.cc index a770ccd3e..81c30719a 100644 --- a/src/lay/lay/layMacroEditorPage.cc +++ b/src/lay/lay/layMacroEditorPage.cc @@ -1720,7 +1720,13 @@ MacroEditorPage::eventFilter (QObject *watched, QEvent *event) } else if (is_find_key (ke)) { QTextCursor c = mp_text->textCursor (); - emit search_requested (c.selectedText ()); + if (c.selectionStart () != c.selectionEnd ()) { + QTextBlock s = mp_text->document ()->findBlock (c.selectionStart ()); + QTextBlock e = mp_text->document ()->findBlock (c.selectionEnd ()); + if (e == s) { + emit search_requested (c.selectedText ()); + } + } return true;