Procházet zdrojové kódy

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

Le Tan před 7 roky
rodič
revize
a96c23fff1
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  1. 6 0
      src/veditor.cpp

+ 6 - 0
src/veditor.cpp

@@ -616,6 +616,12 @@ bool VEditor::findTextHelper(const QString &p_text,
     QRegExp exp;
     QRegExp exp;
     if (p_options & FindOption::RegularExpression) {
     if (p_options & FindOption::RegularExpression) {
         useRegExp = true;
         useRegExp = true;
+        // FIXME: hang bug in Qt's find().
+        QRegExp test("[$^]+");
+        if (test.exactMatch(p_text)) {
+            return false;
+        }
+
         exp = QRegExp(p_text,
         exp = QRegExp(p_text,
                       caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
                       caseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
     }
     }