aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2007-06-25 01:46:25 +0000
committernyamatongwe <devnull@localhost>2007-06-25 01:46:25 +0000
commitfc23a10d8292042571f6a292d6fc4bff73f1d0ab (patch)
tree059f2d45f3344ce332ed27a5b75138633de22bc8
parent48974cb7802717896ed7560bf0520cf942b8c245 (diff)
downloadscintilla-mirror-fc23a10d8292042571f6a292d6fc4bff73f1d0ab.tar.gz
Allow use of all 8 bits for lexical styles and LexHTML set to use 8 buts.
-rw-r--r--include/Scintilla.h2
-rw-r--r--include/Scintilla.iface2
-rw-r--r--src/Editor.cxx4
-rw-r--r--src/LexHTML.cxx24
4 files changed, 16 insertions, 16 deletions
diff --git a/include/Scintilla.h b/include/Scintilla.h
index c50528b72..450865cc1 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -159,7 +159,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define STYLE_INDENTGUIDE 37
#define STYLE_CALLTIP 38
#define STYLE_LASTPREDEFINED 39
-#define STYLE_MAX 127
+#define STYLE_MAX 255
#define SC_CHARSET_ANSI 0
#define SC_CHARSET_DEFAULT 1
#define SC_CHARSET_BALTIC 186
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index b89236b71..b947301ea 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -360,7 +360,7 @@ val STYLE_CONTROLCHAR=36
val STYLE_INDENTGUIDE=37
val STYLE_CALLTIP=38
val STYLE_LASTPREDEFINED=39
-val STYLE_MAX=127
+val STYLE_MAX=255
# Character set identifiers are used in StyleSetCharacterSet.
# The values are the same as the Windows *_CHARSET values.
diff --git a/src/Editor.cxx b/src/Editor.cxx
index c4e86fb09..51c79bc15 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -3035,7 +3035,7 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {
vsPrint.showCaretLineBackground = false;
// Set colours for printing according to users settings
- for (int sty = 0;sty <= STYLE_MAX;sty++) {
+ for (size_t sty = 0;sty < vsPrint.stylesSize;sty++) {
if (printColourMode == SC_PRINT_INVERTLIGHT) {
vsPrint.styles[sty].fore.desired = InvertedLight(vsPrint.styles[sty].fore.desired);
vsPrint.styles[sty].back.desired = InvertedLight(vsPrint.styles[sty].back.desired);
@@ -6489,7 +6489,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
break;
case SCI_TEXTWIDTH:
- PLATFORM_ASSERT(wParam <= vs.stylesSize);
+ PLATFORM_ASSERT(wParam < vs.stylesSize);
PLATFORM_ASSERT(lParam);
return TextWidth(wParam, CharPtrFromSPtr(lParam));
diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx
index eebf5ca1d..c41fcbbfa 100644
--- a/src/LexHTML.cxx
+++ b/src/LexHTML.cxx
@@ -472,8 +472,8 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
WordList &keywords5 = *keywordlists[4];
WordList &keywords6 = *keywordlists[5]; // SGML (DTD) keywords
- // Lexer for HTML requires more lexical states (7 bits worth) than most lexers
- styler.StartAt(startPos, STYLE_MAX);
+ // Lexer for HTML requires more lexical states (8 bits worth) than most lexers
+ styler.StartAt(startPos, static_cast<char>(STYLE_MAX));
char prevWord[200];
prevWord[0] = '\0';
char phpStringDelimiter[200]; // PHP is not limited in length, we are
@@ -495,7 +495,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
length++;
state = styler.StyleAt(startPos);
}
- styler.StartAt(startPos, STYLE_MAX);
+ styler.StartAt(startPos, static_cast<char>(STYLE_MAX));
int lineCurrent = styler.GetLine(startPos);
int lineState;
@@ -1934,8 +1934,8 @@ static void ColouriseASPPiece(StyleContext &sc, WordList *keywordlists[]) {
static void ColouriseASPDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
- // Lexer for HTML requires more lexical states (7 bits worth) than most lexers
- StyleContext sc(startPos, length, initStyle, styler, 0x7f);
+ // Lexer for HTML requires more lexical states (8 bits worth) than most lexers
+ StyleContext sc(startPos, length, initStyle, styler, static_cast<char>(STYLE_MAX));
for (; sc.More(); sc.Forward()) {
ColouriseASPPiece(sc, keywordlists);
}
@@ -2026,8 +2026,8 @@ static void ColourisePHPPiece(StyleContext &sc, WordList *keywordlists[]) {
static void ColourisePHPDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
Accessor &styler) {
- // Lexer for HTML requires more lexical states (7 bits worth) than most lexers
- StyleContext sc(startPos, length, initStyle, styler, 0x7f);
+ // Lexer for HTML requires more lexical states (8 bits worth) than most lexers
+ StyleContext sc(startPos, length, initStyle, styler, static_cast<char>(STYLE_MAX));
for (; sc.More(); sc.Forward()) {
ColourisePHPPiece(sc, keywordlists);
}
@@ -2060,9 +2060,9 @@ static const char * const phpscriptWordListDesc[] = {
0,
};
-LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc, 7);
-LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc, 7);
+LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc, 8);
+LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc, 8);
// SCLEX_ASP and SCLEX_PHP should not be used in new code: use SCLEX_HTML instead.
-LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc, 7);
-LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc, 7);
-LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 7);
+LexerModule lmASP(SCLEX_ASP, ColouriseASPDoc, "asp", 0, htmlWordListDesc, 8);
+LexerModule lmPHP(SCLEX_PHP, ColourisePHPDoc, "php", 0, htmlWordListDesc, 8);
+LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 8);