aboutsummaryrefslogtreecommitdiff
path: root/desktop-utilities/lumina-textedit/syntaxSupport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-utilities/lumina-textedit/syntaxSupport.cpp')
-rw-r--r--desktop-utilities/lumina-textedit/syntaxSupport.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/desktop-utilities/lumina-textedit/syntaxSupport.cpp b/desktop-utilities/lumina-textedit/syntaxSupport.cpp
index 7be190d2..8e2e347a 100644
--- a/desktop-utilities/lumina-textedit/syntaxSupport.cpp
+++ b/desktop-utilities/lumina-textedit/syntaxSupport.cpp
@@ -55,8 +55,9 @@ void Custom_Syntax::loadRules(QString type){
keywords << "char" << "class" << "const" << "double" << "enum" << "explicit" << "friend" << "inline" \
<< "int" << "long" << "namespace" << "operator" << "private" << "protected" << "public" \
<< "short" << "signals" << "signed" << "slots" << "static" << "struct" << "template" \
- << "typedef" << "typename" << "union" << "unsigned" << "virtual" << "void" << "volatile";
-
+ << "typedef" << "typename" << "union" << "unsigned" << "virtual" << "void" << "volatile" \
+ << "true" << "false";
+
SyntaxRule rule;
rule.format.setForeground( QColor(settings->value("colors/keyword").toString()) );
rule.format.setFontWeight(QFont::Bold);
@@ -64,6 +65,14 @@ void Custom_Syntax::loadRules(QString type){
rule.pattern = QRegExp("\\b"+keywords[i]+"\\b"); //turn each keyword into a QRegExp and insert the rule
rules << rule;
}
+ //Alternate Keywords (built-in functions)
+ keywords.clear();
+ keywords << "for" << "while" << "switch" << "case" << "if";
+ rule.format.setForeground( QColor(settings->value("colors/altkeyword").toString()) );
+ for(int i=0; i<keywords.length(); i++){
+ rule.pattern = QRegExp("\\b"+keywords[i]+"\\b"); //turn each keyword into a QRegExp and insert the rule
+ rules << rule;
+ }
//Class Names
rule.format.setForeground( QColor(settings->value("colors/class").toString()) );
rule.pattern = QRegExp("\\bQ[A-Za-z]+\\b");
@@ -190,4 +199,4 @@ void Custom_Syntax::loadRules(QString type){
//srule.endPattern = QRegExp("\\*/");
//splitrules << srule;
}
-} \ No newline at end of file
+}
bgstack15