Mercurial > mxe-octave
comparison 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 |
comparison
equal
deleted
inserted
replaced
3433:4779ae33e544 | 3434:7864014bc84a |
---|---|
1 diff -ur QScintilla-gpl-2.8.orig/lexers/LexMatlab.cpp QScintilla-gpl-2.8.bang/lexers/LexMatlab.cpp | |
2 --- QScintilla-gpl-2.8.orig/lexers/LexMatlab.cpp 2014-01-18 09:19:16 -0500 | |
3 +++ QScintilla-gpl-2.8.bang/lexers/LexMatlab.cpp 2014-01-18 17:09:25 -0500 | |
4 @@ -57,7 +57,7 @@ | |
5 static void ColouriseMatlabOctaveDoc( | |
6 unsigned int startPos, int length, int initStyle, | |
7 WordList *keywordlists[], Accessor &styler, | |
8 - bool (*IsCommentChar)(int)) { | |
9 + bool (*IsCommentChar)(int), bool ismatlab) { | |
10 | |
11 WordList &keywords = *keywordlists[0]; | |
12 | |
13 @@ -199,7 +199,11 @@ | |
14 styler.SetLineState(curLine, commentDepth); | |
15 sc.SetState(SCE_MATLAB_COMMENT); | |
16 } else if (sc.ch == '!' && sc.chNext != '=' ) { | |
17 - sc.SetState(SCE_MATLAB_COMMAND); | |
18 + if (ismatlab) { | |
19 + sc.SetState(SCE_MATLAB_COMMAND); | |
20 + } else { | |
21 + sc.SetState(SCE_MATLAB_OPERATOR); | |
22 + } | |
23 } else if (sc.ch == '\'') { | |
24 if (transpose) { | |
25 sc.SetState(SCE_MATLAB_OPERATOR); | |
26 @@ -229,12 +233,12 @@ | |
27 | |
28 static void ColouriseMatlabDoc(unsigned int startPos, int length, int initStyle, | |
29 WordList *keywordlists[], Accessor &styler) { | |
30 - ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar); | |
31 + ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar, true); | |
32 } | |
33 | |
34 static void ColouriseOctaveDoc(unsigned int startPos, int length, int initStyle, | |
35 WordList *keywordlists[], Accessor &styler) { | |
36 - ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar); | |
37 + ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar, false); | |
38 } | |
39 | |
40 static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int, |