aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2005-03-01 09:47:48 +0000
committernyamatongwe <unknown>2005-03-01 09:47:48 +0000
commitaa086593bb28aa2e7fbeb818ab34b7111e61eb29 (patch)
tree3cd32c38079e694523a0f4560f294740055d5af5 /src
parent5b1bca578b13b67d7474a438479b414776f756ed (diff)
downloadscintilla-mirror-aa086593bb28aa2e7fbeb818ab34b7111e61eb29.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.
Diffstat (limited to 'src')
-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;
}