From a96c23fff11de9d2aafee5cdd17925954d94dcbe Mon Sep 17 00:00:00 2001 From: Le Tan Date: Fri, 31 Aug 2018 20:08:33 +0800 Subject: [PATCH] Editor: fix hang bug in QTextEdit's find() --- src/veditor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/veditor.cpp b/src/veditor.cpp index 0b66c6e1..f8fccf11 100644 --- a/src/veditor.cpp +++ b/src/veditor.cpp @@ -616,6 +616,12 @@ bool VEditor::findTextHelper(const QString &p_text, QRegExp exp; if (p_options & FindOption::RegularExpression) { useRegExp = true; + // FIXME: hang bug in Qt's find(). + QRegExp test("[$^]+"); + if (test.exactMatch(p_text)) { + return false; + } + exp = QRegExp(p_text, caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive); }