annotate src/qscintilla-2-matlab-fold.patch @ 4341:6e4a1de60e8b

qscintilla: add patch for matlab code folding (Bug #42569) * src/qscintilla-2-matlab-fold.patch: new patch file * dist-files.mk: add qscintilla-2-matlab-fold.patch
author John D
date Thu, 19 Jan 2017 08:13:20 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4341
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
1 diff -ur QScintilla_gpl-2.9.3.orig/lexers/LexMatlab.cpp QScintilla_gpl-2.9.3/lexers/LexMatlab.cpp
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
2 --- QScintilla_gpl-2.9.3.orig/lexers/LexMatlab.cpp 2016-11-15 10:56:48.705675755 -0500
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
3 +++ QScintilla_gpl-2.9.3/lexers/LexMatlab.cpp 2016-11-15 18:03:03.938533646 -0500
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
4 @@ -15,6 +15,9 @@
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
5 **
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
6 ** Changes by John Donoghue 2014/08/01
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
7 ** - fix allowed transpose ' after {} operator
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
8 + **
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
9 + ** Changes by John Donoghue 2016/11/15
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
10 + ** - update matlab code folding
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
11 **/
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
12 // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
13 // The License.txt file describes the conditions under which this software may be distributed.
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
14 @@ -48,15 +51,27 @@
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
15 static bool IsOctaveCommentChar(int c) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
16 return (c == '%' || c == '#') ;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
17 }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
18 -
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
19 -static bool IsMatlabComment(Accessor &styler, int pos, int len) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
20 - return len > 0 && IsMatlabCommentChar(styler[pos]) ;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
21 +static inline int LowerCase(int c) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
22 + if (c >= 'A' && c <= 'Z')
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
23 + return 'a' + c - 'A';
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
24 + return c;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
25 }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
26
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
27 -static bool IsOctaveComment(Accessor &styler, int pos, int len) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
28 - return len > 0 && IsOctaveCommentChar(styler[pos]) ;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
29 +static int CheckKeywordFoldPoint(char *str) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
30 + if (strcmp ("if", str) == 0 ||
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
31 + strcmp ("for", str) == 0 ||
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
32 + strcmp ("switch", str) == 0 ||
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
33 + strcmp ("try", str) == 0 ||
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
34 + strcmp ("do", str) == 0 ||
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
35 + strcmp ("parfor", str) == 0 ||
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
36 + strcmp ("function", str) == 0)
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
37 + return 1;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
38 + if (strncmp("end", str, 3) == 0 ||
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
39 + strcmp("until", str) == 0)
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
40 + return -1;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
41 + return 0;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
42 }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
43 -
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
44 +
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
45 static void ColouriseMatlabOctaveDoc(
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
46 unsigned int startPos, int length, int initStyle,
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
47 WordList *keywordlists[], Accessor &styler,
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
48 @@ -245,58 +260,83 @@
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
49 ColouriseMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar, false);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
50 }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
51
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
52 -static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int,
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
53 +static void FoldMatlabOctaveDoc(unsigned int startPos, int length, int initStyle,
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
54 WordList *[], Accessor &styler,
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
55 - bool (*IsComment)(Accessor&, int, int)) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
56 -
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
57 - int endPos = startPos + length;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
58 + bool (*IsComment)(int)) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
59
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
60 - // Backtrack to previous line in case need to fix its fold status
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
61 - int lineCurrent = styler.GetLine(startPos);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
62 - if (startPos > 0) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
63 - if (lineCurrent > 0) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
64 - lineCurrent--;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
65 - startPos = styler.LineStart(lineCurrent);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
66 + unsigned int endPos = startPos + length;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
67 + int visibleChars = 0;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
68 + unsigned int lineCurrent = styler.GetLine(startPos);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
69 + int levelCurrent = SC_FOLDLEVELBASE;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
70 + if (lineCurrent > 0)
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
71 + levelCurrent = styler.LevelAt(lineCurrent-1) >> 16;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
72 + int levelNext = levelCurrent;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
73 + char chNext = styler[startPos];
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
74 + int styleNext = styler.StyleAt(startPos);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
75 + int style = initStyle;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
76 + char word[100];
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
77 + int wordlen = 0;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
78 + for (unsigned int i = startPos; i < endPos; i++) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
79 + char ch = chNext;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
80 + chNext = styler.SafeGetCharAt(i + 1);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
81 +
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
82 + style = styleNext;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
83 + styleNext = styler.StyleAt(i + 1);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
84 + bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
85 +
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
86 + // a line that starts with a comment
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
87 + if (style == SCE_MATLAB_COMMENT && IsComment(ch) && visibleChars == 0) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
88 + // start/end of block comment
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
89 + if (chNext == '{')
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
90 + levelNext ++;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
91 + if (chNext == '}')
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
92 + levelNext --;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
93 }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
94 - }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
95 - int spaceFlags = 0;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
96 - int indentCurrent = styler.IndentAmount(lineCurrent, &spaceFlags, IsComment);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
97 - char chNext = styler[startPos];
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
98 - for (int i = startPos; i < endPos; i++) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
99 - char ch = chNext;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
100 - chNext = styler.SafeGetCharAt(i + 1);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
101 -
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
102 - if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endPos)) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
103 - int lev = indentCurrent;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
104 - int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsComment);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
105 - if (!(indentCurrent & SC_FOLDLEVELWHITEFLAG)) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
106 - // Only non whitespace lines can be headers
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
107 - if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext & SC_FOLDLEVELNUMBERMASK)) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
108 - lev |= SC_FOLDLEVELHEADERFLAG;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
109 - } else if (indentNext & SC_FOLDLEVELWHITEFLAG) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
110 - // Line after is blank so check the next - maybe should continue further?
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
111 - int spaceFlags2 = 0;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
112 - int indentNext2 = styler.IndentAmount(lineCurrent + 2, &spaceFlags2, IsComment);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
113 - if ((indentCurrent & SC_FOLDLEVELNUMBERMASK) < (indentNext2 & SC_FOLDLEVELNUMBERMASK)) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
114 - lev |= SC_FOLDLEVELHEADERFLAG;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
115 - }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
116 - }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
117 + // keyword
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
118 + if(style == SCE_MATLAB_KEYWORD) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
119 + word[wordlen++] = static_cast<char>(LowerCase(ch));
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
120 + if (wordlen == 100) { // prevent overflow
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
121 + word[0] = '\0';
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
122 + wordlen = 1;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
123 + }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
124 + if (styleNext != SCE_MATLAB_KEYWORD) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
125 + word[wordlen] = '\0';
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
126 + wordlen = 0;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
127 +
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
128 + levelNext += CheckKeywordFoldPoint(word);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
129 + }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
130 + }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
131 + if (!IsASpace(ch))
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
132 + visibleChars++;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
133 + if (atEOL || (i == endPos-1)) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
134 + int levelUse = levelCurrent;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
135 + int lev = levelUse | levelNext << 16;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
136 + if (visibleChars == 0)
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
137 + lev |= SC_FOLDLEVELWHITEFLAG;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
138 + if (levelUse < levelNext)
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
139 + lev |= SC_FOLDLEVELHEADERFLAG;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
140 + if (lev != styler.LevelAt(lineCurrent)) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
141 + styler.SetLevel(lineCurrent, lev);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
142 }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
143 - indentCurrent = indentNext;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
144 - styler.SetLevel(lineCurrent, lev);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
145 lineCurrent++;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
146 + levelCurrent = levelNext;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
147 + if (atEOL && (i == static_cast<unsigned int>(styler.Length() - 1))) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
148 + // There is an empty line at end of file so give it same level and empty
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
149 + styler.SetLevel(lineCurrent, (levelCurrent | levelCurrent << 16) | SC_FOLDLEVELWHITEFLAG);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
150 + }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
151 + visibleChars = 0;
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
152 }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
153 - }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
154 + }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
155 }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
156
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
157 static void FoldMatlabDoc(unsigned int startPos, int length, int initStyle,
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
158 WordList *keywordlists[], Accessor &styler) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
159 - FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabComment);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
160 + FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsMatlabCommentChar);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
161 }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
162
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
163 static void FoldOctaveDoc(unsigned int startPos, int length, int initStyle,
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
164 WordList *keywordlists[], Accessor &styler) {
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
165 - FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveComment);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
166 + FoldMatlabOctaveDoc(startPos, length, initStyle, keywordlists, styler, IsOctaveCommentChar);
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
167 }
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
168
6e4a1de60e8b qscintilla: add patch for matlab code folding (Bug #42569)
John D
parents:
diff changeset
169 static const char * const matlabWordListDesc[] = {