diff options
-rw-r--r-- | src/DocumentAccessor.cxx | 5 |
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; } |