Diff of /lexers/LexPerl.cxx [04d3fd] .. [658206] Maximize Restore

  Switch to unified view

a/lexers/LexPerl.cxx b/lexers/LexPerl.cxx
...
...
189
}
189
}
190
190
191
static int podLineScan(LexAccessor &styler, unsigned int &pos, unsigned int endPos) {
191
static int podLineScan(LexAccessor &styler, unsigned int &pos, unsigned int endPos) {
192
    // forward scan the current line to classify line for POD style
192
    // forward scan the current line to classify line for POD style
193
    int state = -1;
193
    int state = -1;
194
    while (pos <= endPos) {
194
    while (pos < endPos) {
195
        int ch = static_cast<unsigned char>(styler.SafeGetCharAt(pos));
195
        int ch = static_cast<unsigned char>(styler.SafeGetCharAt(pos));
196
        if (ch == '\n' || ch == '\r' || pos >= endPos) {
196
        if (ch == '\n' || ch == '\r') {
197
            if (ch == '\r' && styler.SafeGetCharAt(pos + 1) == '\n') pos++;
197
            if (ch == '\r' && styler.SafeGetCharAt(pos + 1) == '\n') pos++;
198
            break;
198
            break;
199
        }
199
        }
200
        if (IsASpaceOrTab(ch)) {    // whitespace, take note
200
        if (IsASpaceOrTab(ch)) {    // whitespace, take note
201
            if (state == -1)
201
            if (state == -1)
...
...
941
                int pod = podLineScan(styler, fw, endPos);  // classify POD line
941
                int pod = podLineScan(styler, fw, endPos);  // classify POD line
942
                styler.SetLineState(ln, pod);
942
                styler.SetLineState(ln, pod);
943
                if (pod == SCE_PL_DEFAULT) {
943
                if (pod == SCE_PL_DEFAULT) {
944
                    if (sc.state == SCE_PL_POD_VERB) {
944
                    if (sc.state == SCE_PL_POD_VERB) {
945
                        unsigned int fw2 = fw;
945
                        unsigned int fw2 = fw;
946
                        while (fw2 <= endPos && pod == SCE_PL_DEFAULT) {
946
                        while (fw2 < (endPos - 1) && pod == SCE_PL_DEFAULT) {
947
                            fw = fw2++; // penultimate line (last blank line)
947
                            fw = fw2++; // penultimate line (last blank line)
948
                            pod = podLineScan(styler, fw2, endPos);
948
                            pod = podLineScan(styler, fw2, endPos);
949
                            styler.SetLineState(styler.GetLine(fw2), pod);
949
                            styler.SetLineState(styler.GetLine(fw2), pod);
950
                        }
950
                        }
951
                        if (pod == SCE_PL_POD) {    // truncate verbatim POD early
951
                        if (pod == SCE_PL_POD) {    // truncate verbatim POD early
...
...
963
                        pod = SCE_PL_POD_VERB;
963
                        pod = SCE_PL_POD_VERB;
964
                        styler.SetLineState(ln, pod);
964
                        styler.SetLineState(ln, pod);
965
                    }
965
                    }
966
                    sc.SetState(pod);
966
                    sc.SetState(pod);
967
                }
967
                }
968
                sc.Forward(fw - sc.currentPos); // commit style
968
                sc.ForwardBytes(fw - sc.currentPos); // commit style
969
            }
969
            }
970
            break;
970
            break;
971
        case SCE_PL_REGEX:
971
        case SCE_PL_REGEX:
972
        case SCE_PL_STRING_QR:
972
        case SCE_PL_STRING_QR:
973
            if (Quote.Rep <= 0) {
973
            if (Quote.Rep <= 0) {