aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-textedit
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2016-09-06 13:19:58 -0400
committerKen Moore <ken@pcbsd.org>2016-09-06 13:19:58 -0400
commit067953bb48b05c6627883a4ec9b3906b72f93973 (patch)
treea238295d1205ca97a0f7455b133fee002859468a /src-qt5/desktop-utils/lumina-textedit
parentQuick fix to OS-detect.pri: If LINUX_DISTRO was manually set through qmake, d... (diff)
downloadlumina-067953bb48b05c6627883a4ec9b3906b72f93973.tar.gz
lumina-067953bb48b05c6627883a4ec9b3906b72f93973.tar.bz2
lumina-067953bb48b05c6627883a4ec9b3906b72f93973.zip
Clean up a bit more of the syntaxhighlighting rules - ensuring that single-line rules are skipped if they start within a multi-line rule block.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp2
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
index 9997961b..60f5af57 100644
--- a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.cpp
@@ -67,7 +67,7 @@ void Custom_Syntax::loadRules(QString type){
}
//Alternate Keywords (built-in functions)
keywords.clear();
- keywords << "for" << "while" << "switch" << "case" << "if";
+ keywords << "for" << "while" << "switch" << "case" << "if" << "else" << "return" << "exit";
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
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
index ad8a592b..8f5e5a77 100644
--- a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
+++ b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
@@ -97,7 +97,7 @@ protected:
for(int i=0; i<rules.length(); i++){
QRegExp patt(rules[i].pattern); //need a copy of the rule's pattern (will be changing it below)
int index = patt.indexIn(text);
- if(splitactive>=0 && index>=start){ continue; } //skip this one - falls within a multi-line pattern above
+ if(splitactive>=0 || index<start){ continue; } //skip this one - falls within a multi-line pattern above
while(index>=0){
int len = patt.matchedLength();
setFormat(index, len, rules[i].format);
bgstack15