aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2005-03-01 09:47:48 +0000
committernyamatongwe <devnull@localhost>2005-03-01 09:47:48 +0000
commitcbc79a0aa37c2cbb7d5da2ab20341ae16b008d70 (patch)
tree3cd32c38079e694523a0f4560f294740055d5af5
parentb223aa4de85c2be6bcd74b4f72fb9e02594b3edc (diff)
downloadscintilla-mirror-cbc79a0aa37c2cbb7d5da2ab20341ae16b008d70.tar.gz
Patch from Jan Martin Pettersen to ensure lexers only see the bits in each
style byte they are interested in and not of any other indicators added by the container.
-rw-r--r--src/DocumentAccessor.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/DocumentAccessor.cxx b/src/DocumentAccessor.cxx
index 738eca7a0..f479ce025 100644
--- a/src/DocumentAccessor.cxx
+++ b/src/DocumentAccessor.cxx
@@ -58,7 +58,8 @@ bool DocumentAccessor::Match(int pos, const char *s) {
}
char DocumentAccessor::StyleAt(int position) {
- return pdoc->StyleAt(position);
+ // Mask off all bits which aren't in the 'mask'.
+ return static_cast<char>(pdoc->StyleAt(position) & mask);
}
int DocumentAccessor::GetLine(int position) {
@@ -88,6 +89,8 @@ int DocumentAccessor::SetLineState(int line, int state) {
}
void DocumentAccessor::StartAt(unsigned int start, char chMask) {
+ // Store the mask specified for use with StyleAt.
+ mask = chMask;
pdoc->StartStyling(start, chMask);
startPosStyling = start;
}