annotate src/qscintilla-2-matlab-block-comment.patch @ 4410:9b1f851080b6

qscitilla: update to 2.10.1 * src/qscintilla.mk: update version, checksum, use -std=c++11, use _qtX notation of lib names * src/qscintilla-1-fixes.patch: update patch * src/qscintilla-2-matlab-fold.patch: removed patch * src/qscintilla-3-matlab-block-comment.patch: update patch, rename => qscintilla-2-matlab-block-comment.patch * src/qscintilla-4-matlab-end-op.patch: update patch, rename => qscintilla-3-matlab-end-op.patch * dist-files.mk: add qscintilla-2-matlab-block-comment.patch, scintilla-3-matlab-end-op.patch, remove qscintilla-2-matlab-fold.patch qscintilla-4-matlab-end-op.patch qscintilla-3-matlab-block-comment.patch
author John D
date Mon, 10 Jul 2017 17:00:55 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4410
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
1 diff -ur QScintilla_gpl-2.10.1.orig/lexers/LexMatlab.cpp QScintilla_gpl-2.10.1/lexers/LexMatlab.cpp
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
2 --- QScintilla_gpl-2.10.1.orig/lexers/LexMatlab.cpp 2017-07-05 08:05:16.545914398 -0400
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
3 +++ QScintilla_gpl-2.10.1/lexers/LexMatlab.cpp 2017-07-05 08:19:56.616722104 -0400
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
4 @@ -73,6 +73,15 @@
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
5 return 0;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
6 }
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
7
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
8 +static bool IsSpaceToEOL(Sci_PositionU startPos, Accessor &styler) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
9 + Sci_Position line = styler.GetLine(startPos);
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
10 + Sci_PositionU eol_pos = styler.LineStart(line + 1) - 1;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
11 + for (Sci_PositionU i = startPos; i < eol_pos; i++) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
12 + char ch = styler[i];
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
13 + if(!IsASpace(ch)) return false;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
14 + }
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
15 + return true;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
16 +}
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
17
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
18 static void ColouriseMatlabOctaveDoc(
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
19 Sci_PositionU startPos, Sci_Position length, int initStyle,
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
20 @@ -180,7 +189,7 @@
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
21 }
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
22 } else if (sc.state == SCE_MATLAB_COMMENT) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
23 // end or start of a nested a block comment?
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
24 - if( IsCommentChar(sc.ch) && sc.chNext == '}' && nonSpaceColumn == column) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
25 + if( IsCommentChar(sc.ch) && sc.chNext == '}' && nonSpaceColumn == column && IsSpaceToEOL(sc.currentPos+2, styler)) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
26 if(commentDepth > 0) commentDepth --;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
27
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
28 curLine = styler.GetLine(sc.currentPos);
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
29 @@ -192,7 +201,7 @@
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
30 transpose = false;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
31 }
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
32 }
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
33 - else if( IsCommentChar(sc.ch) && sc.chNext == '{' && nonSpaceColumn == column)
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
34 + else if( IsCommentChar(sc.ch) && sc.chNext == '{' && nonSpaceColumn == column && IsSpaceToEOL(sc.currentPos+2, styler))
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
35 {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
36 commentDepth ++;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
37
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
38 @@ -213,9 +222,12 @@
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
39 // check start of a new state
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
40 if (sc.state == SCE_MATLAB_DEFAULT) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
41 if (IsCommentChar(sc.ch)) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
42 - // ncrement depth if we are a block comment
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
43 - if(sc.chNext == '{' && nonSpaceColumn == column)
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
44 - commentDepth ++;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
45 + // Increment depth if we are a block comment
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
46 + if(sc.chNext == '{' && nonSpaceColumn == column) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
47 + if(IsSpaceToEOL(sc.currentPos+2, styler)) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
48 + commentDepth ++;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
49 + }
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
50 + }
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
51 curLine = styler.GetLine(sc.currentPos);
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
52 styler.SetLineState(curLine, commentDepth);
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
53 sc.SetState(SCE_MATLAB_COMMENT);
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
54 @@ -288,9 +300,9 @@
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
55 // a line that starts with a comment
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
56 if (style == SCE_MATLAB_COMMENT && IsComment(ch) && visibleChars == 0) {
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
57 // start/end of block comment
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
58 - if (chNext == '{')
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
59 + if (chNext == '{' && IsSpaceToEOL(i+2, styler))
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
60 levelNext ++;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
61 - if (chNext == '}')
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
62 + if (chNext == '}' && IsSpaceToEOL(i+2, styler))
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
63 levelNext --;
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
64 }
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
65 // keyword
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
66 Only in QScintilla_gpl-2.10.1/lexers: LexMatlab.cpp.orig
9b1f851080b6 qscitilla: update to 2.10.1
John D
parents:
diff changeset
67 Only in QScintilla_gpl-2.10.1/lexers: LexMatlab.cpp.rej