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

This commit is contained in:
Matthias Koefferlein 2021-06-09 21:58:16 +02:00
parent 2337149eb5
commit a4039a1bf8
1 changed files with 7 additions and 1 deletions

View File

@ -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;