view src/qscintilla-2-bang-fix.patch @ 3434:7864014bc84a

Add qscintilla patch for ! operator (Bug #41270) * src/qscintilla-2-bang-fix.patch: New file. * dist-files.mk: added qscintilla-2-bang-fix.patch.
author John Donoghue <john.donoghue@ieee.org>
date Sun, 19 Jan 2014 17:37:35 -0500
parents
children
line wrap: on
line source

diff -ur QScintilla-gpl-2.8.orig/lexers/LexMatlab.cpp QScintilla-gpl-2.8.bang/lexers/LexMatlab.cpp
--- QScintilla-gpl-2.8.orig/lexers/LexMatlab.cpp	2014-01-18 09:19:16 -0500
+++ QScintilla-gpl-2.8.bang/lexers/LexMatlab.cpp	2014-01-18 17:09:25 -0500
@@ -57,7 +57,7 @@
 static void ColouriseMatlabOctaveDoc(
             unsigned int startPos, int length, int initStyle,
             WordList *keywordlists[], Accessor &styler,
-            bool (*IsCommentChar)(int)) {
+            bool (*IsCommentChar)(int), bool ismatlab) {
 
 	WordList &keywords = *keywordlists[0];
 
@@ -199,7 +199,11 @@
 				styler.SetLineState(curLine, commentDepth);
 				sc.SetState(SCE_MATLAB_COMMENT);
 			} else if (sc.ch == '!' && sc.chNext != '=' ) {
-				sc.SetState(SCE_MATLAB_COMMAND);
+                                if (ismatlab) {
+				  sc.SetState(SCE_MATLAB_COMMAND);
+                                } else {
+				  sc.SetState(SCE_MATLAB_OPERATOR);
+                                }
 			} else if (sc.ch == '\'') {
 				if (transpose) {
 					sc.SetState(SCE_MATLAB_OPERATOR);
@@ -229,12 +233,12 @@
 
 static void ColouriseMatlabDoc(unsigned int startPos, int length, int initStyle,
                                WordList *keywordlists[], Accessor &styler) {
-	ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar);
+	ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar, true);
 }
 
 static void ColouriseOctaveDoc(unsigned int startPos, int length, int initStyle,
                                WordList *keywordlists[], Accessor &styler) {
-	ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar);
+	ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar, false);
 }
 
 static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int,