diff options
author | Neil <nyamatongwe@gmail.com> | 2014-05-31 09:27:48 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-05-31 09:27:48 +1000 |
commit | 9bc61b338dfe63d2e6fcc66bc0933a0de6bcd31b (patch) | |
tree | 64c541e9dcb42c9999759ab7dd40d67c72749b9a /src/Document.cxx | |
parent | 8326c658b392ba13e92918dd89deebd60bcd195f (diff) | |
parent | 8b447b76bbc110e055a0637657f5f00c65cc98dd (diff) | |
download | scintilla-mirror-9bc61b338dfe63d2e6fcc66bc0933a0de6bcd31b.tar.gz |
Merge 343-Win32-Fix which fixes hangs and crashes at shutdown on Windows.
Diffstat (limited to 'src/Document.cxx')
-rw-r--r-- | src/Document.cxx | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 0108669c2..32d5f1896 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -8,8 +8,8 @@ #include <stdlib.h> #include <string.h> #include <stdio.h> -#include <ctype.h> #include <assert.h> +#include <ctype.h> #include <string> #include <vector> @@ -20,13 +20,13 @@ #include "ILexer.h" #include "Scintilla.h" +#include "CharacterSet.h" #include "SplitVector.h" #include "Partitioning.h" #include "RunStyles.h" #include "CellBuffer.h" #include "PerLine.h" #include "CharClassify.h" -#include "CharacterSet.h" #include "Decoration.h" #include "CaseFolder.h" #include "Document.h" @@ -58,7 +58,7 @@ void LexInterface::Colourise(int start, int end) { int styleStart = 0; if (start > 0) - styleStart = pdoc->StyleAt(start - 1) & pdoc->stylingBitsMask; + styleStart = pdoc->StyleAt(start - 1); if (len > 0) { instance->Lex(start, len, styleStart, pdoc); @@ -90,9 +90,6 @@ Document::Document() { #endif dbcsCodePage = 0; lineEndBitSet = SC_LINE_END_TYPE_DEFAULT; - stylingBits = 5; - stylingBitsMask = 0x1F; - stylingMask = 0; endStyled = 0; styleClock = 0; enteredModification = 0; @@ -1712,13 +1709,7 @@ int Document::GetCharsOfClass(CharClassify::cc characterClass, unsigned char *bu return charClass.GetCharsOfClass(characterClass, buffer); } -void Document::SetStylingBits(int bits) { - stylingBits = bits; - stylingBitsMask = (1 << stylingBits) - 1; -} - -void SCI_METHOD Document::StartStyling(int position, char mask) { - stylingMask = mask; +void SCI_METHOD Document::StartStyling(int position, char) { endStyled = position; } @@ -1727,9 +1718,8 @@ bool SCI_METHOD Document::SetStyleFor(int length, char style) { return false; } else { enteredStyling++; - style &= stylingMask; int prevEndStyled = endStyled; - if (cb.SetStyleFor(endStyled, length, style, stylingMask)) { + if (cb.SetStyleFor(endStyled, length, style)) { DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER, prevEndStyled, length); NotifyModified(mh); @@ -1750,7 +1740,7 @@ bool SCI_METHOD Document::SetStyles(int length, const char *styles) { int endMod = 0; for (int iPos = 0; iPos < length; iPos++, endStyled++) { PLATFORM_ASSERT(endStyled < Length()); - if (cb.SetStyleAt(endStyled, styles[iPos], stylingMask)) { + if (cb.SetStyleAt(endStyled, styles[iPos])) { if (!didChange) { startMod = endStyled; } @@ -2080,7 +2070,7 @@ int Document::BraceMatch(int position, int /*maxReStyle*/) { char chSeek = BraceOpposite(chBrace); if (chSeek == '\0') return - 1; - char styBrace = static_cast<char>(StyleAt(position) & stylingBitsMask); + char styBrace = static_cast<char>(StyleAt(position)); int direction = -1; if (chBrace == '(' || chBrace == '[' || chBrace == '{' || chBrace == '<') direction = 1; @@ -2088,7 +2078,7 @@ int Document::BraceMatch(int position, int /*maxReStyle*/) { position = NextPosition(position, direction); while ((position >= 0) && (position < Length())) { char chAtPos = CharAt(position); - char styAtPos = static_cast<char>(StyleAt(position) & stylingBitsMask); + char styAtPos = static_cast<char>(StyleAt(position)); if ((position > GetEndStyled()) || (styAtPos == styBrace)) { if (chAtPos == chBrace) depth++; |