From 79083e6a77f403ca606ae45d3fa933ad26fd6547 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Tue, 6 Sep 2016 13:41:44 -0400 Subject: Another couple quick fixes for the C/C++ regex rules: don't highlight the Qt classes anymore (Q*), and instead use that rule to highlight any subclass definitions (*::). --- src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src-qt5/desktop-utils/lumina-textedit') diff --git a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp index 60f5af57..695730f7 100644 --- a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp +++ b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp @@ -52,7 +52,7 @@ void Custom_Syntax::loadRules(QString type){ if(type=="C++"){ //Keywords (standard C/C++/Qt definitions) QStringList keywords; - keywords << "char" << "class" << "const" << "double" << "enum" << "explicit" << "friend" << "inline" \ + keywords << "char" << "class" << "const" << "double" << "enum" << "explicit" << "extern" << "friend" << "inline" \ << "int" << "long" << "namespace" << "operator" << "private" << "protected" << "public" \ << "short" << "signals" << "signed" << "slots" << "static" << "struct" << "template" \ << "typedef" << "typename" << "union" << "unsigned" << "virtual" << "void" << "volatile" \ @@ -75,7 +75,7 @@ void Custom_Syntax::loadRules(QString type){ } //Class Names rule.format.setForeground( QColor(settings->value("colors/class").toString()) ); - rule.pattern = QRegExp("\\bQ[A-Za-z]+\\b"); + rule.pattern = QRegExp("\\b[A-Za-z0-9_-\\.]+(?=::)\\b"); rules << rule; //Quotes rule.format.setForeground( QColor(settings->value("colors/text").toString()) ); -- cgit