aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2001-01-19 23:15:07 +0000
committernyamatongwe <unknown>2001-01-19 23:15:07 +0000
commite33b91b20ca2cc7b241b73b1ce07e413a6d342a6 (patch)
treeed264cf1097a2d46297e15f65e461ca76c19e887
parentc9e16e4c1635bf87b774babcec00c6e66ecb0ec5 (diff)
downloadscintilla-mirror-e33b91b20ca2cc7b241b73b1ce07e413a6d342a6.tar.gz
Patch from Steffen to handle single character words better and generally
improve handling of words.
-rw-r--r--src/LexPerl.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/LexPerl.cxx b/src/LexPerl.cxx
index 443aad8f5..0604ca776 100644
--- a/src/LexPerl.cxx
+++ b/src/LexPerl.cxx
@@ -251,6 +251,10 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
} else {
state = SCE_PL_WORD;
preferRE = false;
+ if (!iswordchar(chNext)) { // if length of word == 1 !!!
+ classifyWordPerl(styler.GetStartSegment(), i, keywords, styler);
+ state = SCE_PL_DEFAULT;
+ }
}
} else if (ch == '#') {
styler.ColourTo(i - 1, state);
@@ -348,8 +352,8 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
styler.ColourTo(i, SCE_PL_OPERATOR);
}
} else if (state == SCE_PL_WORD) {
- if ((!iswordchar(ch) && ch != '\'')
- || (ch == '.' && chNext == '.')) {
+ if ((!iswordchar(chNext) && chNext != '\'')
+ || (chNext == '.' && chNext2 == '.')) {
// ".." is always an operator if preceded by a SCE_PL_WORD.
// Archaic Perl has quotes inside names
if (isMatch(styler, lengthDoc, styler.GetStartSegment(), "__DATA__")) {
@@ -359,9 +363,11 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
styler.ColourTo(i, SCE_PL_DATASECTION);
state = SCE_PL_DATASECTION;
} else {
- if (classifyWordPerl(styler.GetStartSegment(), i - 1, keywords, styler) == SCE_PL_WORD)
+ if (classifyWordPerl(styler.GetStartSegment(), i, keywords, styler) == SCE_PL_WORD)
preferRE = true;
state = SCE_PL_DEFAULT;
+ ch = ' ';
+/*
if (ch == '#') {
state = SCE_PL_COMMENTLINE;
} else if (ch == '\"') {
@@ -383,6 +389,7 @@ static void ColourisePerlDoc(unsigned int startPos, int length, int initStyle,
styler.ColourTo(i, SCE_PL_OPERATOR);
state = SCE_PL_DEFAULT;
}
+*/
}
}
} else {