aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaHistory.html2
-rw-r--r--lexers/LexPerl.cxx8
2 files changed, 5 insertions, 5 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 691df493d..bba105c0c 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -466,7 +466,7 @@
by stricter checking of ctags lines.
</li>
<li>
- Perl lexer fixes bugs with multi-byte characters, including in HEREDOCs.
+ Perl lexer fixes bugs with multi-byte characters, including in HEREDOCs and PODs.
<a href="http://sourceforge.net/p/scintilla/bugs/1528/">Bug #1528</a>.
</li>
<li>
diff --git a/lexers/LexPerl.cxx b/lexers/LexPerl.cxx
index fe169f071..d6fa7446c 100644
--- a/lexers/LexPerl.cxx
+++ b/lexers/LexPerl.cxx
@@ -191,9 +191,9 @@ static int styleCheckIdentifier(LexAccessor &styler, unsigned int bk) {
static int podLineScan(LexAccessor &styler, unsigned int &pos, unsigned int endPos) {
// forward scan the current line to classify line for POD style
int state = -1;
- while (pos <= endPos) {
+ while (pos < endPos) {
int ch = static_cast<unsigned char>(styler.SafeGetCharAt(pos));
- if (ch == '\n' || ch == '\r' || pos >= endPos) {
+ if (ch == '\n' || ch == '\r') {
if (ch == '\r' && styler.SafeGetCharAt(pos + 1) == '\n') pos++;
break;
}
@@ -943,7 +943,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
if (pod == SCE_PL_DEFAULT) {
if (sc.state == SCE_PL_POD_VERB) {
unsigned int fw2 = fw;
- while (fw2 <= endPos && pod == SCE_PL_DEFAULT) {
+ while (fw2 < (endPos - 1) && pod == SCE_PL_DEFAULT) {
fw = fw2++; // penultimate line (last blank line)
pod = podLineScan(styler, fw2, endPos);
styler.SetLineState(styler.GetLine(fw2), pod);
@@ -965,7 +965,7 @@ void SCI_METHOD LexerPerl::Lex(unsigned int startPos, int length, int initStyle,
}
sc.SetState(pod);
}
- sc.Forward(fw - sc.currentPos); // commit style
+ sc.ForwardBytes(fw - sc.currentPos); // commit style
}
break;
case SCE_PL_REGEX: