diff --git a/gui/codeeditor.cpp b/gui/codeeditor.cpp index 555158e10..832dcf609 100644 --- a/gui/codeeditor.cpp +++ b/gui/codeeditor.cpp @@ -71,20 +71,24 @@ Highlighter::Highlighter(QTextDocument *parent, << "export" << "extern" << "false" + << "final" << "float" << "for" << "friend" << "goto" << "if" + << "import" << "inline" << "int" << "long" + << "module" << "mutable" << "namespace" << "new" << "noexcept" << "nullptr" << "operator" + << "override" << "private" << "protected" << "public" @@ -130,7 +134,9 @@ Highlighter::Highlighter(QTextDocument *parent, mQuotationFormat.setForeground(mWidgetStyle->quoteColor); mQuotationFormat.setFontWeight(mWidgetStyle->quoteWeight); - rule.pattern = QRegularExpression("\".*\""); + // We use lazy `*?` instead greed `*` quantifier to find the real end of the c-string. + // We use negative lookbehind assertion `(?