aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2016-09-06 15:11:10 -0400
committerKen Moore <ken@pcbsd.org>2016-09-06 15:11:10 -0400
commit1450d08cda59a030d0c9717a07c13d87b73eedd4 (patch)
tree6a04dc7116294850bf264bb340550966039d2c1e /src-qt5
parentAdd a new test.cpp file for checking C/C++ syntax stuff, and fix up the backw... (diff)
downloadlumina-1450d08cda59a030d0c9717a07c13d87b73eedd4.tar.gz
lumina-1450d08cda59a030d0c9717a07c13d87b73eedd4.tar.bz2
lumina-1450d08cda59a030d0c9717a07c13d87b73eedd4.zip
Fix up another multi-line syntax highlighting routine.
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h7
-rw-r--r--src-qt5/desktop-utils/lumina-textedit/tests/test.cpp4
2 files changed, 7 insertions, 4 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
index d3ff9a0c..e4c4242c 100644
--- a/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
+++ b/src-qt5/desktop-utils/lumina-textedit/syntaxSupport.h
@@ -61,15 +61,16 @@ protected:
//Find the end of the current rule
int end = splitrules[splitactive].endPattern.indexIn(text, start);
if(end==-1){
- //qDebug() << "Highlight to end of line:" << text << start;
+ qDebug() << "Highlight to end of line:" << text << start;
//rule did not finish - apply to all
if(start>0){ setFormat(start-1, text.length()-start+1, splitrules[splitactive].format); }
else{ setFormat(start, text.length()-start, splitrules[splitactive].format); }
break; //stop looking for more multi-line patterns
}else{
- //Found end point
- //qDebug() << "Highlight to particular point:" << text << start << end;
+ //Found end point within the same line
+ qDebug() << "Highlight to particular point:" << text << start << end;
int len = end-start+splitrules[splitactive].endPattern.matchedLength();
+ if(start>0){ start--; len++; } //need to include the first character as well
setFormat(start, len , splitrules[splitactive].format);
start+=len; //move pointer to the end of handled range
splitactive = -1; //done with this rule
diff --git a/src-qt5/desktop-utils/lumina-textedit/tests/test.cpp b/src-qt5/desktop-utils/lumina-textedit/tests/test.cpp
index f78748bf..1b50e302 100644
--- a/src-qt5/desktop-utils/lumina-textedit/tests/test.cpp
+++ b/src-qt5/desktop-utils/lumina-textedit/tests/test.cpp
@@ -9,5 +9,7 @@ some stuff // in-line comment
some stuff /*multi
line
-comment*/
+comment */
stuff
+
+some /*single line comment with multi-line tags */
bgstack15