4410
|
1 diff -ur QScintilla_gpl-2.10.1.orig/lexers/LexMatlab.cpp QScintilla_gpl-2.10.1/lexers/LexMatlab.cpp |
|
2 --- QScintilla_gpl-2.10.1.orig/lexers/LexMatlab.cpp 2017-07-05 08:21:58.527158553 -0400 |
|
3 +++ QScintilla_gpl-2.10.1/lexers/LexMatlab.cpp 2017-07-05 08:22:26.304941561 -0400 |
|
4 @@ -97,6 +97,9 @@ |
|
5 // of a string |
|
6 bool transpose = false; |
|
7 |
|
8 + // count for brackets for when 'end' could be an operator not a keyword |
|
9 + int allow_end_op = 0; |
|
10 + |
|
11 // approximate position of first non space character in a line |
|
12 int nonSpaceColumn = -1; |
|
13 // approximate column position of the current character in a line |
|
14 @@ -151,6 +154,9 @@ |
|
15 char s[100]; |
|
16 sc.GetCurrentLowered(s, sizeof(s)); |
|
17 if (keywords.InList(s)) { |
|
18 + if (strcmp ("end", s) == 0 && allow_end_op > 0) { |
|
19 + sc.ChangeState(SCE_MATLAB_NUMBER); |
|
20 + } |
|
21 sc.SetState(SCE_MATLAB_DEFAULT); |
|
22 transpose = false; |
|
23 } else { |
|
24 @@ -250,6 +256,12 @@ |
|
25 } else if (isalpha(sc.ch)) { |
|
26 sc.SetState(SCE_MATLAB_KEYWORD); |
|
27 } else if (isoperator(static_cast<char>(sc.ch)) || sc.ch == '@' || sc.ch == '\\') { |
|
28 + if (sc.ch == '(' || sc.ch == '[' || sc.ch == '{') { |
|
29 + allow_end_op ++; |
|
30 + } else if ((sc.ch == ')' || sc.ch == ']' || sc.ch == '}') && (allow_end_op > 0)) { |
|
31 + allow_end_op --; |
|
32 + } |
|
33 + |
|
34 if (sc.ch == ')' || sc.ch == ']' || sc.ch == '}') { |
|
35 transpose = true; |
|
36 } else { |
|
37 Only in QScintilla_gpl-2.10.1/lexers: LexMatlab.cpp.orig |
|
38 Only in QScintilla_gpl-2.10.1/lexers: LexMatlab.cpp.rej |