# HG changeset patch # User John Donoghue # Date 1390171055 18000 # Node ID 7864014bc84a31039bf96764c8a36fed7f7ef8d3 # Parent 4779ae33e54443c519e85e772b59784dbafa30c9 Add qscintilla patch for ! operator (Bug #41270) * src/qscintilla-2-bang-fix.patch: New file. * dist-files.mk: added qscintilla-2-bang-fix.patch. diff -r 4779ae33e544 -r 7864014bc84a dist-files.mk --- a/dist-files.mk Sun Jan 19 10:11:30 2014 -0500 +++ b/dist-files.mk Sun Jan 19 17:37:35 2014 -0500 @@ -486,6 +486,7 @@ qrupdate-1-fixes.patch \ qrupdate.mk \ qscintilla-1-fixes.patch \ + qscintilla-2-bang-fix.patch \ qscintilla.mk \ qt-1-cherrypicks.patch \ qt-1-pcre.patch \ diff -r 4779ae33e544 -r 7864014bc84a src/qscintilla-2-bang-fix.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/qscintilla-2-bang-fix.patch Sun Jan 19 17:37:35 2014 -0500 @@ -0,0 +1,40 @@ +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,