aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
index 327d4738..10eec73d 100644
--- a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
@@ -163,19 +163,26 @@ void Custom_Syntax::loadRules(QString type){
rule.format.setFontWeight(QFont::Normal);
rule.pattern = QRegExp( "\"[^\"\\\\]*(\\\\(.|\\n)[^\"\\\\]*)*\"|'[^'\\\\]*(\\\\(.|\\n)[^'\\\\]*)*'");
rules << rule;
+ //TODO
+ rule = SyntaxRule(); //reset rule
+ rule.format.setFontWeight( QFont::Bold );
+ rule.pattern = QRegExp("\\bTODO\\b");
+ rules << rule;
//Functions
- rule.format.setForeground( QColor(settings->value("colors/function").toString()) );
- rule.pattern = QRegExp("\\b[A-Za-z0-9_]+(?=\\()");
+ rule = SyntaxRule(); //reset rule
+ rule.format.setBackground( QColor(settings->value("colors/function").toString()) );
+ rule.pattern = QRegExp("^(\\s*)\\.\\.(\\s*)\\b_[a-zA-Z0-9]*:(\\s|$)");
rules << rule;
- //Comment (single line)
- rule.format.setForeground( QColor(settings->value("colors/comment").toString()) );
- rule.pattern = QRegExp("^(\\s*)\\.\\.\\s(?![\\w-_\\.]+::(\\s|$))");
+ //figures and other statements
+ rule = SyntaxRule(); //reset rule
+ rule.format.setForeground( QColor(settings->value("colors/function").toString()) );
+ rule.pattern = QRegExp("^(\\s*)\\.\\.\\sfigure::\\s");
rules << rule;
//Comment (multi-line)
- /*SyntaxRuleSplit srule;
+ SyntaxRuleSplit srule;
srule.format.setForeground( QColor(settings->value("colors/comment").toString()) );
- srule.startPattern = QRegExp("^[..]\\s[^_]");
- srule.endPattern = QRegExp("^[^\\s]");
- splitrules << srule;*/
+ srule.startPattern = QRegExp("^(\\s*)\\.\\.\\s[^_](?![\\w-_\\.]+::(\\s|$))");
+ srule.endPattern = QRegExp("^(?=([^\\.\\s]|$))");
+ splitrules << srule;
}
}
bgstack15