瀏覽代碼

Editor: fix hang bug in QTextEdit's find()

Le Tan 7 年之前
父節點
當前提交
a96c23fff1
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/veditor.cpp

+ 6 - 0
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);
     }