diff options
-rw-r--r-- | doc/ScintillaDoc.html | 139 | ||||
-rw-r--r-- | lexers/LexHTML.cxx | 11 | ||||
-rw-r--r-- | lexers/LexMySQL.cxx | 2 | ||||
-rw-r--r-- | lexers/LexPerl.cxx | 2 | ||||
-rw-r--r-- | lexers/LexRuby.cxx | 5 | ||||
-rw-r--r-- | lexlib/LexAccessor.h | 20 | ||||
-rw-r--r-- | lexlib/LexerModule.cxx | 12 | ||||
-rw-r--r-- | lexlib/LexerModule.h | 9 | ||||
-rw-r--r-- | lexlib/StyleContext.h | 4 | ||||
-rw-r--r-- | src/CellBuffer.cxx | 13 | ||||
-rw-r--r-- | src/CellBuffer.h | 4 | ||||
-rw-r--r-- | src/Document.cxx | 22 | ||||
-rw-r--r-- | src/Document.h | 5 | ||||
-rw-r--r-- | src/Editor.cxx | 78 | ||||
-rw-r--r-- | src/PositionCache.cxx | 5 | ||||
-rw-r--r-- | src/PositionCache.h | 2 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 10 | ||||
-rw-r--r-- | src/ViewStyle.h | 2 | ||||
-rw-r--r-- | test/simpleTests.py | 4 |
19 files changed, 99 insertions, 250 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 5350e8537..e0880b071 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -364,20 +364,9 @@ <h2 id="TextRetrievalAndModification">Text retrieval and modification</h2> - <p>Each byte in a Scintilla document is followed by an associated byte of styling + <p>Each byte in a Scintilla document is associated with a byte of styling information. The combination of a character byte and a style byte is called a cell. Style bytes - are interpreted an index into an array of styles. - Style bytes may be split into an index and a set of indicator bits - but this use is discouraged and indicators should now use - <a class="message" href ="#SCI_INDICATORFILLRANGE">SCI_INDICATORFILLRANGE</a> - and related calls. - The default split is with the index in the low 5 bits and 3 high bits as <a class="jump" - href="#Indicators">indicators</a>. This allows 32 fundamental styles, which is enough for most - languages, and three independent indicators so that, for example, syntax errors, deprecated - names and bad indentation could all be displayed at once. The number of bits used for styles - can be altered with <a class="message" - href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a> up to a maximum of 8 bits. - The remaining bits can be used for indicators.</p> + are interpreted an index into an array of styles.</p> <p>In this document, 'character' normally refers to a byte even when multi-byte characters are used. Lengths measure the numbers of bytes, not the amount of characters in those bytes.</p> @@ -421,8 +410,6 @@ <a class="message" href="#SCI_GETSTYLEAT">SCI_GETSTYLEAT(int position)</a><br /> <a class="message" href="#SCI_GETSTYLEDTEXT">SCI_GETSTYLEDTEXT(<unused>, Sci_TextRange *tr)</a><br /> - <a class="message" href="#SCI_SETSTYLEBITS">SCI_SETSTYLEBITS(int bits)</a><br /> - <a class="message" href="#SCI_GETSTYLEBITS">SCI_GETSTYLEBITS</a><br /> <a class="message" href="#SCI_RELEASEALLEXTENDEDSTYLES">SCI_RELEASEALLEXTENDEDSTYLES</a><br /> <a class="message" href="#SCI_ALLOCATEEXTENDEDSTYLES">SCI_ALLOCATEEXTENDEDSTYLES(int numberStyles)</a><br /> <a class="message" href="#SCI_TARGETASUTF8">SCI_TARGETASUTF8(<unused>, char *s)</a><br /> @@ -570,14 +557,6 @@ This returns the style at <code>pos</code> in the document, or 0 if <code>pos</code> is negative or past the end of the document.</p> - <p><b id="SCI_SETSTYLEBITS">SCI_SETSTYLEBITS(int bits)</b><br /> - <b id="SCI_GETSTYLEBITS">SCI_GETSTYLEBITS</b><br /> - This pair of routines sets and reads back the number of bits in each cell to use for styling, - to a maximum of 8 style bits. The remaining bits can be used as indicators. The standard - setting is <code>SCI_SETSTYLEBITS(5)</code>. - The number of styling bits needed by the current lexer can be found with - <a class="message" href="#SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</a>.</p> - <p><b id="SCI_RELEASEALLEXTENDEDSTYLES">SCI_RELEASEALLEXTENDEDSTYLES</b><br /> <b id="SCI_ALLOCATEEXTENDEDSTYLES">SCI_ALLOCATEEXTENDEDSTYLES(int numberStyles)</b><br /> Extended styles are used for features like textual margins and annotations as well as internally by Scintilla. @@ -2329,12 +2308,7 @@ struct Sci_TextToFind { <h2 id="Styling">Styling</h2> - <p>The styling messages allow you to assign styles to text. The standard Scintilla settings - divide the 8 style bits available for each character into 5 bits (0 to 4 = <a class="jump" - href="#StyleDefinition">styles 0 to 31</a>) that set a style and three bits (5 to 7) that - define <a class="jump" href="#Indicators">indicators</a>. You can change the balance between - styles and indicators with <a class="message" - href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a>. If your styling needs can be met by + <p>The styling messages allow you to assign styles to text. If your styling needs can be met by one of the standard lexers, or if you can write your own, then a lexer is probably the easiest way to style your document. If you choose to use the container to do the styling you can use the <a class="message" href="#SCI_SETLEXER"><code>SCI_SETLEXER</code></a> command to select @@ -2345,7 +2319,7 @@ struct Sci_TextToFind { use the styling commands to mark errors detected by a compiler. The following commands can be used.</p> <code><a class="message" href="#SCI_GETENDSTYLED">SCI_GETENDSTYLED</a><br /> - <a class="message" href="#SCI_STARTSTYLING">SCI_STARTSTYLING(int position, int mask)</a><br /> + <a class="message" href="#SCI_STARTSTYLING">SCI_STARTSTYLING(int position, int unused)</a><br /> <a class="message" href="#SCI_SETSTYLING">SCI_SETSTYLING(int length, int style)</a><br /> <a class="message" href="#SCI_SETSTYLINGEX">SCI_SETSTYLINGEX(int length, const char *styles)</a><br /> @@ -2363,31 +2337,23 @@ struct Sci_TextToFind { container. The container can send <code>SCI_GETENDSTYLED</code> to work out where it needs to start styling. Scintilla will always ask to style whole lines.</p> - <p><b id="SCI_STARTSTYLING">SCI_STARTSTYLING(int pos, int mask)</b><br /> - This prepares for styling by setting the styling position <code>pos</code> to start at and a - <code>mask</code> indicating which bits of the style bytes can be set. The mask allows styling - to occur over several passes, with, for example, basic styling done on an initial pass to - ensure that the text of the code is seen quickly and correctly, and then a second slower pass, - detecting syntax errors and using indicators to show where these are. For example, with the - standard settings of 5 style bits and 3 indicator bits, you would use a <code>mask</code> value - of 31 (0x1f) if you were setting text styles and did not want to change the indicators. After + <p><b id="SCI_STARTSTYLING">SCI_STARTSTYLING(int pos, int unused)</b><br /> + This prepares for styling by setting the styling position <code>pos</code> to start at. + The unused argument was used in earlier versions but is now ignored. + After <code>SCI_STARTSTYLING</code>, send multiple <code>SCI_SETSTYLING</code> messages for each lexical entity to style.</p> <p><b id="SCI_SETSTYLING">SCI_SETSTYLING(int length, int style)</b><br /> This message sets the style of <code>length</code> characters starting at the styling position - and then increases the styling position by <code>length</code>, ready for the next call. If - <code>sCell</code> is the style byte, the operation is:<br /> - <code>if ((sCell & mask) != style) sCell = (sCell & ~mask) | (style & - mask);</code><br /> + and then increases the styling position by <code>length</code>, ready for the next call.<br /> </p> <p><b id="SCI_SETSTYLINGEX">SCI_SETSTYLINGEX(int length, const char *styles)</b><br /> As an alternative to <code>SCI_SETSTYLING</code>, which applies the same style to each byte, you can use this message which specifies the styles for each of <code>length</code> bytes from the styling position and then increases the styling position by <code>length</code>, ready for - the next call. The <code>length</code> styling bytes pointed at by <code>styles</code> should - not contain any bits not set in mask.</p> + the next call.</p> <p><b id="SCI_SETLINESTATE">SCI_SETLINESTATE(int line, int value)</b><br /> <b id="SCI_GETLINESTATE">SCI_GETLINESTATE(int line)</b><br /> @@ -2405,9 +2371,8 @@ struct Sci_TextToFind { <p>While the style setting messages mentioned above change the style numbers associated with text, these messages define how those style numbers are interpreted visually. There are 256 - lexer styles that can be set, numbered 0 to <code>STYLE_MAX</code> (255). Unless you use <a - class="message" href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a> to change the number - of style bits, styles 0 to 31 are used to set the text attributes. There are also some + lexer styles that can be set, numbered 0 to <code>STYLE_MAX</code> (255). + There are also some predefined numbered styles starting at 32, The following <code>STYLE_</code>* constants are defined.</p> @@ -2504,9 +2469,7 @@ struct Sci_TextToFind { <td>255</td> <td>This is not a style but is the number of the maximum style that can be set. Styles - between <code>STYLE_LASTPREDEFINED</code> and <code>STYLE_MAX</code> would be appropriate - if you used <a class="message" href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a> - to set more than 5 style bits.</td> + between <code>STYLE_LASTPREDEFINED</code> and <code>STYLE_MAX</code> may be used.</td> </tr> </tbody> </table> @@ -3196,9 +3159,6 @@ struct Sci_TextToFind { </p> <h2 id="OtherSettings">Other settings</h2> - <code><a class="message" href="#SCI_SETUSEPALETTE">SCI_SETUSEPALETTE(bool - allowPaletteUse)</a><br /> - <a class="message" href="#SCI_GETUSEPALETTE">SCI_GETUSEPALETTE</a><br /> <a class="message" href="#SCI_SETBUFFEREDDRAW">SCI_SETBUFFEREDDRAW(bool isBuffered)</a><br /> <a class="message" href="#SCI_GETBUFFEREDDRAW">SCI_GETBUFFEREDDRAW</a><br /> <a class="message" href="#SCI_SETTWOPHASEDRAW">SCI_SETTWOPHASEDRAW(bool twoPhase)</a><br /> @@ -3839,10 +3799,7 @@ struct Sci_TextToFind { <p>Indicators are used to display additional information over the top of styling. They can be used to show, for example, syntax errors, deprecated names and bad indentation - by drawing underlines under text or boxes around text. Originally, Scintilla stored indicator information in - the style bytes but this has proved limiting, so now up to 32 separately stored indicators may be used. - While style byte indicators currently still work, they will soon be removed so all the bits in each style - byte can be used for lexical states.</p> + by drawing underlines under text or boxes around text.</p> <p>Indicators may be displayed as simple underlines, squiggly underlines, a line of small 'T' shapes, a line of diagonal hatching, a strike-out or a rectangle around the text.</p> @@ -3853,6 +3810,12 @@ struct Sci_TextToFind { by lexers (0..7) and a range for use by containers (8=<code>INDIC_CONTAINER</code> .. 31=<code>INDIC_MAX</code>).</p> + <p>Originally, Scintilla used a different technique for indicators but this + has been <a href="#RemovedFeatures">removed</a> + and the APIs perform <a href="#StyleByteIndicators">no action</a>. + While both techniques were supported, the term "modern indicators" was used for the + newer implementation.</p> + <code><a class="message" href="#SCI_INDICSETSTYLE">SCI_INDICSETSTYLE(int indicatorNumber, int indicatorStyle)</a><br /> <a class="message" href="#SCI_INDICGETSTYLE">SCI_INDICGETSTYLE(int indicatorNumber)</a><br /> @@ -4074,12 +4037,10 @@ struct Sci_TextToFind { <p><b id="SCI_INDICSETUNDER">SCI_INDICSETUNDER(int indicatorNumber, bool under)</b><br /> <b id="SCI_INDICGETUNDER">SCI_INDICGETUNDER(int indicatorNumber)</b><br /> These two messages set and get whether an indicator is drawn under text or over(default). - Drawing under text works only for modern indicators when <a class="message" href="#SCI_SETTWOPHASEDRAW">two phase drawing</a> + Drawing under text works only for indicators when <a class="message" href="#SCI_SETTWOPHASEDRAW">two phase drawing</a> is enabled.</p> - <h3 id="ModernIndicators">Modern Indicators</h3> - - <p>Modern indicators are stored in a format similar to run length encoding which is efficient in both + <p>Indicators are stored in a format similar to run length encoding which is efficient in both speed and storage for sparse information.</p> <p>An indicator may store different values for each range but currently all values are drawn the same. In the future, it may be possible to draw different values in different styles.</p> @@ -4146,32 +4107,8 @@ struct Sci_TextToFind { This message hides the find indicator. </p> - <h3 id="StyleByteIndicators">Style Byte Indicators (deprecated)</h3> - <p>By default, Scintilla organizes the style byte associated with each text byte as 5 bits of - style information (for 32 styles) and 3 bits of indicator information for 3 independent - indicators so that, for example, syntax errors, deprecated names and bad indentation could all - be displayed at once.</p> - - <p>The indicators are set using <a class="message" - href="#SCI_STARTSTYLING"><code>SCI_STARTSTYLING</code></a> with a <code>INDICS_MASK</code> mask - and <a class="message" href="#SCI_SETSTYLING"><code>SCI_SETSTYLING</code></a> with the values - <code>INDIC0_MASK</code>, <code>INDIC1_MASK</code> and <code>INDIC2_MASK</code>.</p> - - <p>If you are using indicators in a buffer that has a lexer active - (see <a class="message" href="#SCI_SETLEXER"><code>SCI_SETLEXER</code></a>), - you must save lexing state information before setting any indicators and restore it afterwards. - Use <a class="message" href="#SCI_GETENDSTYLED"><code>SCI_GETENDSTYLED</code></a> - to retrieve the current "styled to" position and - <a class="message" href="#SCI_STARTSTYLING"><code>SCI_STARTSTYLING</code></a> - to reset the styling position and mask (<code>0x1f </code> in the default layout of 5 style bits and 3 indicator bits) - when you are done.</p> - - <p>The number of bits used for styles can be altered with <a class="message" - href="#SCI_SETSTYLEBITS"><code>SCI_SETSTYLEBITS</code></a> from 0 to 8 bits. The remaining bits - can be used for indicators, so there can be from 1 to 8 indicators. However, the - <code>INDIC*_MASK</code> constants defined in <code>Scintilla.h</code> all assume 5 bits of - styling information and 3 indicators. If you use a different arrangement, you must define your - own constants.</p> + <p>Earlier versions of Scintilla allowed <a href="#StyleByteIndicators">partitioning style bytes</a> + between style numbers and indicators and provided APIs for setting and querying this.</p> <h2 id="Autocompletion">Autocompletion</h2> @@ -5968,7 +5905,6 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ <a class="message" href="#SCI_DESCRIBEKEYWORDSETS">SCI_DESCRIBEKEYWORDSETS(<unused>, char *descriptions)</a><br /> <a class="message" href="#SCI_SETKEYWORDS">SCI_SETKEYWORDS(int keyWordSet, const char *keyWordList)</a><br /> - <a class="message" href="#SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</a><br /> <a class="message" href="#SCI_GETSUBSTYLEBASES">SCI_GETSUBSTYLEBASES(<unused>, char *styles)</a><br /> <a class="message" href="#SCI_DISTANCETOSECONDARYSTYLES">SCI_DISTANCETOSECONDARYSTYLES</a><br /> @@ -6118,11 +6054,6 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ <p><b id="SCI_DESCRIBEKEYWORDSETS">SCI_DESCRIBEKEYWORDSETS(<unused>, char *descriptions)</b><br /> A description of all of the keyword sets separated by "\n" is returned by <code>SCI_DESCRIBEKEYWORDSETS</code>.</p> - <p><b id="SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</b><br /> - Retrieve the number of bits the current lexer needs for styling. This should normally be the argument - to <a class="message" href="#SCI_SETSTYLEBITS">SCI_SETSTYLEBITS</a>. - </p> - <h3 id="Substyles">Substyles</h3> <p>Lexers may support several different sublanguages and each sublanguage may want to style some number of sets of identifiers (or similar lexemes such as documentation keywords) uniquely. Preallocating a large number for each @@ -6441,6 +6372,8 @@ segments then changing the statement <code>#define BEOS 0</code> to <code>#defin document. The lexer can call <code>ChangeLexerState</code> to signal to the document that it should relex and display more.</p> +<p>For <code>StartStyling</code> the mask argument has no effect. It was used in version 3.4.2 and earlier.</p> + <p><code>SetErrorStatus</code> is used to notify the document of exceptions. Exceptions should not be thrown over build boundaries as the two sides may be built with different compilers or incompatible @@ -7481,6 +7414,20 @@ EM_FORMATRANGE <b id="SCI_GETUSEPALETTE">SCI_GETUSEPALETTE</b> Deprecated<br /> Scintilla no longer supports palette mode. The last version to support palettes was 2.29. Any calls to these methods should be removed.</p> + + <p>The following are features that should be removed from calling code but are still + defined to avoid breaking callers.</p> + + <p id="StyleByteIndicators"><b id="SCI_SETSTYLEBITS">SCI_SETSTYLEBITS(int bits)</b> Deprecated<br /> + <b id="SCI_GETSTYLEBITS">SCI_GETSTYLEBITS</b> Deprecated<br /> + <b id="SCI_GETSTYLEBITSNEEDED">SCI_GETSTYLEBITSNEEDED</b> Deprecated<br /> + <code>INDIC0_MASK</code>, <code>INDIC1_MASK</code>, <code>INDIC2_MASK</code>, <code>INDICS_MASK</code> Deprecated<br /> + Scintilla no longer supports style byte indicators. The last version to support style byte indicators was 3.4.2. + Any use of these symbols should be removed and replaced with <a href="#Indicators">standard indicators</a>. + <code>SCI_GETSTYLEBITS</code> and <code>SCI_GETSTYLEBITSNEEDED</code> always return 8, + indicating that 8 bits are used for styling and there are 256 styles.</p> + </p> + <h2 id="EditMessagesNeverSupportedByScintilla">Edit messages never supported by Scintilla</h2> <pre> @@ -7517,6 +7464,12 @@ EM_SETTARGETDEVICE that makes sense. As it is not intended for use in a word processor, some edit messages can not be sensibly handled. Unsupported messages have no effect.</p> + <h2 id="RemovedFeatures">Removed features</h2> + + <p>Previous versions of Scintilla allowed indicators to be stord in bits of each style byte. + This was deprecated in 2007 and removed in 2014 with release 3.4.3. + All uses of style byte indicators should be replaced with <a href="#Indicators">standard indicators</a>.</p> + <h2 id="BuildingScintilla">Building Scintilla</h2> <p>To build Scintilla or SciTE, see the README file present in both the Scintilla and SciTE diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx index f5da934d2..d6b0b31bc 100644 --- a/lexers/LexHTML.cxx +++ b/lexers/LexHTML.cxx @@ -576,8 +576,7 @@ 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 (8 bits worth) than most lexers - styler.StartAt(startPos, static_cast<unsigned char>(STYLE_MAX)); + styler.StartAt(startPos); char prevWord[200]; prevWord[0] = '\0'; char phpStringDelimiter[200]; // PHP is not limited in length, we are @@ -609,7 +608,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty if (startPos == 0) state = SCE_H_DEFAULT; } - styler.StartAt(startPos, static_cast<unsigned char>(STYLE_MAX)); + styler.StartAt(startPos); int lineCurrent = styler.GetLine(startPos); int lineState; @@ -2180,6 +2179,6 @@ static const char * const phpscriptWordListDesc[] = { 0, }; -LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc, 8); -LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc, 8); -LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc, 8); +LexerModule lmHTML(SCLEX_HTML, ColouriseHTMLDoc, "hypertext", 0, htmlWordListDesc); +LexerModule lmXML(SCLEX_XML, ColouriseXMLDoc, "xml", 0, htmlWordListDesc); +LexerModule lmPHPSCRIPT(SCLEX_PHPSCRIPT, ColourisePHPScriptDoc, "phpscript", 0, phpscriptWordListDesc); diff --git a/lexers/LexMySQL.cxx b/lexers/LexMySQL.cxx index d3e0033b0..b873ccda1 100644 --- a/lexers/LexMySQL.cxx +++ b/lexers/LexMySQL.cxx @@ -570,4 +570,4 @@ static const char * const mysqlWordListDesc[] = { 0 }; -LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc, 7); +LexerModule lmMySQL(SCLEX_MYSQL, ColouriseMySQLDoc, "mysql", FoldMySQLDoc, mysqlWordListDesc); diff --git a/lexers/LexPerl.cxx b/lexers/LexPerl.cxx index 8fa516b34..b4a2dd12e 100644 --- a/lexers/LexPerl.cxx +++ b/lexers/LexPerl.cxx @@ -1726,4 +1726,4 @@ void SCI_METHOD LexerPerl::Fold(unsigned int startPos, int length, int /* initSt styler.SetLevel(lineCurrent, levelPrev | flagsNext); } -LexerModule lmPerl(SCLEX_PERL, LexerPerl::LexerFactoryPerl, "perl", perlWordListDesc, 8); +LexerModule lmPerl(SCLEX_PERL, LexerPerl::LexerFactoryPerl, "perl", perlWordListDesc); diff --git a/lexers/LexRuby.cxx b/lexers/LexRuby.cxx index e19a5147e..f818d3d47 100644 --- a/lexers/LexRuby.cxx +++ b/lexers/LexRuby.cxx @@ -705,8 +705,7 @@ static void ColouriseRbDoc(unsigned int startPos, int length, int initStyle, char chPrev = styler.SafeGetCharAt(startPos - 1); char chNext = styler.SafeGetCharAt(startPos); bool is_real_number = true; // Differentiate between constants and ?-sequences. - // Ruby uses a different mask because bad indentation is marked by oring with 32 - styler.StartAt(startPos, 127); + styler.StartAt(startPos); styler.StartSegment(startPos); static int q_states[] = {SCE_RB_STRING_Q, @@ -1776,4 +1775,4 @@ static const char * const rubyWordListDesc[] = { 0 }; -LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc, rubyWordListDesc, 6); +LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc, rubyWordListDesc); diff --git a/lexlib/LexAccessor.h b/lexlib/LexAccessor.h index 45a3a0a93..35e15726c 100644 --- a/lexlib/LexAccessor.h +++ b/lexlib/LexAccessor.h @@ -29,11 +29,8 @@ private: int codePage; enum EncodingType encodingType; int lenDoc; - int mask; char styleBuf[bufferSize]; int validLen; - char chFlags; - char chWhile; unsigned int startSeg; int startPosStyling; int documentVersion; @@ -58,7 +55,7 @@ public: codePage(pAccess->CodePage()), encodingType(enc8bit), lenDoc(pAccess->Length()), - mask(127), validLen(0), chFlags(0), chWhile(0), + validLen(0), startSeg(0), startPosStyling(0), documentVersion(pAccess->Version()) { switch (codePage) { @@ -111,7 +108,7 @@ public: return true; } char StyleAt(int position) const { - return static_cast<char>(pAccess->StyleAt(position) & mask); + return static_cast<char>(pAccess->StyleAt(position)); } int GetLine(int position) const { return pAccess->LineFromPosition(position); @@ -152,16 +149,10 @@ public: return pAccess->SetLineState(line, state); } // Style setting - void StartAt(unsigned int start, char chMask=31) { - // Store the mask specified for use with StyleAt. - mask = chMask; - pAccess->StartStyling(start, chMask); + void StartAt(unsigned int start) { + pAccess->StartStyling(start, '\377'); startPosStyling = start; } - void SetFlags(char chFlags_, char chWhile_) { - chFlags = chFlags_; - chWhile = chWhile_; - } unsigned int GetStartSegment() const { return startSeg; } @@ -182,9 +173,6 @@ public: // Too big for buffer so send directly pAccess->SetStyleFor(pos - startSeg + 1, static_cast<char>(chAttr)); } else { - if (chAttr != chWhile) - chFlags = 0; - chAttr = static_cast<char>(chAttr | chFlags); for (unsigned int i = startSeg; i <= pos; i++) { assert((startPosStyling + validLen) < Length()); styleBuf[validLen++] = static_cast<char>(chAttr); diff --git a/lexlib/LexerModule.cxx b/lexlib/LexerModule.cxx index c77b31775..5b25f84ec 100644 --- a/lexlib/LexerModule.cxx +++ b/lexlib/LexerModule.cxx @@ -34,28 +34,24 @@ LexerModule::LexerModule(int language_, LexerFunction fnLexer_, const char *languageName_, LexerFunction fnFolder_, - const char *const wordListDescriptions_[], - int styleBits_) : + const char *const wordListDescriptions_[]) : language(language_), fnLexer(fnLexer_), fnFolder(fnFolder_), fnFactory(0), wordListDescriptions(wordListDescriptions_), - styleBits(styleBits_), languageName(languageName_) { } LexerModule::LexerModule(int language_, LexerFactoryFunction fnFactory_, const char *languageName_, - const char * const wordListDescriptions_[], - int styleBits_) : + const char * const wordListDescriptions_[]) : language(language_), fnLexer(0), fnFolder(0), fnFactory(fnFactory_), wordListDescriptions(wordListDescriptions_), - styleBits(styleBits_), languageName(languageName_) { } @@ -82,10 +78,6 @@ const char *LexerModule::GetWordListDescription(int index) const { } } -int LexerModule::GetStyleBitsNeeded() const { - return styleBits; -} - ILexer *LexerModule::Create() const { if (fnFactory) return fnFactory(); diff --git a/lexlib/LexerModule.h b/lexlib/LexerModule.h index 35fa30c69..ee092e68f 100644 --- a/lexlib/LexerModule.h +++ b/lexlib/LexerModule.h @@ -31,7 +31,6 @@ protected: LexerFunction fnFolder; LexerFactoryFunction fnFactory; const char * const * wordListDescriptions; - int styleBits; public: const char *languageName; @@ -39,13 +38,11 @@ public: LexerFunction fnLexer_, const char *languageName_=0, LexerFunction fnFolder_=0, - const char * const wordListDescriptions_[] = NULL, - int styleBits_=5); + const char * const wordListDescriptions_[] = NULL); LexerModule(int language_, LexerFactoryFunction fnFactory_, const char *languageName_, - const char * const wordListDescriptions_[] = NULL, - int styleBits_=8); + const char * const wordListDescriptions_[] = NULL); virtual ~LexerModule() { } int GetLanguage() const { return language; } @@ -54,8 +51,6 @@ public: int GetNumWordLists() const; const char *GetWordListDescription(int index) const; - int GetStyleBitsNeeded() const; - ILexer *Create() const; virtual void Lex(unsigned int startPos, int length, int initStyle, diff --git a/lexlib/StyleContext.h b/lexlib/StyleContext.h index 9b5ce5dff..837386cef 100644 --- a/lexlib/StyleContext.h +++ b/lexlib/StyleContext.h @@ -66,7 +66,7 @@ public: int widthNext; StyleContext(unsigned int startPos, unsigned int length, - int initStyle, LexAccessor &styler_, char chMask=31) : + int initStyle, LexAccessor &styler_, char chMask='\377') : styler(styler_), multiByteAccess(0), endPos(startPos + length), @@ -86,7 +86,7 @@ public: if (styler.Encoding() != enc8bit) { multiByteAccess = styler.MultiByteAccess(); } - styler.StartAt(startPos, chMask); + styler.StartAt(startPos /*, chMask*/); styler.StartSegment(startPos); currentLine = styler.GetLine(startPos); lineStartNext = styler.LineStart(currentLine+1); diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index c05060865..0c56c9e92 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -413,25 +413,24 @@ const char *CellBuffer::InsertString(int position, const char *s, int insertLeng return data; } -bool CellBuffer::SetStyleAt(int position, char styleValue, char mask) { - styleValue &= mask; +bool CellBuffer::SetStyleAt(int position, char styleValue) { char curVal = style.ValueAt(position); - if ((curVal & mask) != styleValue) { - style.SetValueAt(position, static_cast<char>((curVal & ~mask) | styleValue)); + if (curVal != styleValue) { + style.SetValueAt(position, styleValue); return true; } else { return false; } } -bool CellBuffer::SetStyleFor(int position, int lengthStyle, char styleValue, char mask) { +bool CellBuffer::SetStyleFor(int position, int lengthStyle, char styleValue) { bool changed = false; PLATFORM_ASSERT(lengthStyle == 0 || (lengthStyle > 0 && lengthStyle + position <= style.Length())); while (lengthStyle--) { char curVal = style.ValueAt(position); - if ((curVal & mask) != styleValue) { - style.SetValueAt(position, static_cast<char>((curVal & ~mask) | styleValue)); + if (curVal != styleValue) { + style.SetValueAt(position, styleValue); changed = true; } position++; diff --git a/src/CellBuffer.h b/src/CellBuffer.h index 6b719de27..f07b45983 100644 --- a/src/CellBuffer.h +++ b/src/CellBuffer.h @@ -180,8 +180,8 @@ public: /// Setting styles for positions outside the range of the buffer is safe and has no effect. /// @return true if the style of a character is changed. - bool SetStyleAt(int position, char styleValue, char mask='\377'); - bool SetStyleFor(int position, int length, char styleValue, char mask); + bool SetStyleAt(int position, char styleValue); + bool SetStyleFor(int position, int length, char styleValue); const char *DeleteChars(int position, int deleteLength, bool &startSequence); diff --git a/src/Document.cxx b/src/Document.cxx index 0108669c2..b986a1cfd 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -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++; diff --git a/src/Document.h b/src/Document.h index e2414bd36..8212db674 100644 --- a/src/Document.h +++ b/src/Document.h @@ -206,7 +206,6 @@ private: CellBuffer cb; CharClassify charClass; CaseFolder *pcf; - char stylingMask; int endStyled; int styleClock; int enteredModification; @@ -229,9 +228,6 @@ public: LexInterface *pli; - int stylingBits; - int stylingBitsMask; - int eolMode; /// Can also be SC_CP_UTF8 to enable UTF-8 mode int dbcsCodePage; @@ -369,7 +365,6 @@ public: void SetDefaultCharClasses(bool includeWordClass); void SetCharClasses(const unsigned char *chars, CharClassify::cc newCharClass); int GetCharsOfClass(CharClassify::cc charClass, unsigned char *buffer); - void SetStylingBits(int bits); void SCI_METHOD StartStyling(int position, char mask); bool SCI_METHOD SetStyleFor(int length, char style); bool SCI_METHOD SetStyles(int length, const char *styles); diff --git a/src/Editor.cxx b/src/Editor.cxx index 4966d8efd..7fbe39c38 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -885,9 +885,8 @@ bool Editor::RangeContainsProtected(int start, int end) const { start = end; end = t; } - int mask = pdoc->stylingBitsMask; for (int pos = start; pos < end; pos++) { - if (vs.styles[pdoc->StyleAt(pos) & mask].IsProtected()) + if (vs.styles[pdoc->StyleAt(pos)].IsProtected()) return true; } } @@ -916,17 +915,16 @@ SelectionPosition Editor::MovePositionOutsideChar(SelectionPosition pos, int mov if (posMoved != pos.Position()) pos.SetPosition(posMoved); if (vs.ProtectionActive()) { - int mask = pdoc->stylingBitsMask; if (moveDir > 0) { - if ((pos.Position() > 0) && vs.styles[pdoc->StyleAt(pos.Position() - 1) & mask].IsProtected()) { + if ((pos.Position() > 0) && vs.styles[pdoc->StyleAt(pos.Position() - 1)].IsProtected()) { while ((pos.Position() < pdoc->Length()) && - (vs.styles[pdoc->StyleAt(pos.Position()) & mask].IsProtected())) + (vs.styles[pdoc->StyleAt(pos.Position())].IsProtected())) pos.Add(1); } } else if (moveDir < 0) { - if (vs.styles[pdoc->StyleAt(pos.Position()) & mask].IsProtected()) { + if (vs.styles[pdoc->StyleAt(pos.Position())].IsProtected()) { while ((pos.Position() > 0) && - (vs.styles[pdoc->StyleAt(pos.Position() - 1) & mask].IsProtected())) + (vs.styles[pdoc->StyleAt(pos.Position() - 1)].IsProtected())) pos.Add(-1); } } @@ -2178,7 +2176,6 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou if (lineLength == ll->numCharsInLine) { // See if chars, styles, indicators, are all the same bool allSame = true; - const int styleMask = pdoc->stylingBitsMask; // Check base line layout char styleByte = 0; int numCharsInLine = 0; @@ -2187,9 +2184,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou char chDoc = pdoc->CharAt(charInDoc); styleByte = pdoc->StyleAt(charInDoc); allSame = allSame && - (ll->styles[numCharsInLine] == static_cast<unsigned char>(styleByte & styleMask)); - allSame = allSame && - (ll->indicators[numCharsInLine] == static_cast<char>(styleByte & ~styleMask)); + (ll->styles[numCharsInLine] == static_cast<unsigned char>(styleByte)); if (vstyle.styles[ll->styles[numCharsInLine]].caseForce == Style::caseMixed) allSame = allSame && (ll->chars[numCharsInLine] == chDoc); @@ -2223,8 +2218,6 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou ll->edgeColumn = -1; } - const int styleMask = pdoc->stylingBitsMask; - ll->styleBitsSet = 0; // Fill base line layout const int lineLength = posLineEnd - posLineStart; pdoc->GetCharRange(ll->chars, posLineStart, lineLength); @@ -2233,11 +2226,9 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou const int numCharsInLine = (vstyle.viewEOL) ? lineLength : numCharsBeforeEOL; for (int styleInLine = 0; styleInLine < numCharsInLine; styleInLine++) { const unsigned char styleByte = ll->styles[styleInLine]; - ll->styleBitsSet |= styleByte; - ll->styles[styleInLine] = styleByte & styleMask; - ll->indicators[styleInLine] = static_cast<char>(styleByte & ~styleMask); + ll->styles[styleInLine] = styleByte; } - const unsigned char styleByteLast = ((lineLength > 0) ? ll->styles[lineLength-1] : 0) & styleMask; + const unsigned char styleByteLast = (lineLength > 0) ? ll->styles[lineLength-1] : 0; if (vstyle.someStylesForceCase) { for (int charInLine = 0; charInLine<lineLength; charInLine++) { char chDoc = ll->chars[charInLine]; @@ -2251,7 +2242,6 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou // Extra element at the end of the line to hold end x position and act as ll->chars[numCharsInLine] = 0; // Also triggers processing in the loops as this is a control character ll->styles[numCharsInLine] = styleByteLast; // For eolFilled - ll->indicators[numCharsInLine] = 0; // Layout the line, determining the position of each character, // with an extra element at the end for the end of the line. @@ -2508,7 +2498,6 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin bool drawWrapMarkEnd, ColourDesired wrapColour) { const int posLineStart = pdoc->LineStart(line); - const int styleMask = pdoc->stylingBitsMask; PRectangle rcSegment = rcLine; const bool lastSubLine = subLine == (ll->lines - 1); @@ -2523,7 +2512,7 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin if (virtualSpace) { rcSegment.left = xEol + xStart; rcSegment.right = xEol + xStart + virtualSpace; - surface->FillRectangle(rcSegment, overrideBackground ? background : vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back); + surface->FillRectangle(rcSegment, overrideBackground ? background : vsDraw.styles[ll->styles[ll->numCharsInLine]].back); if (!hideSelection && ((vsDraw.selAlpha == SC_ALPHA_NOALPHA) || (vsDraw.selAdditionalAlpha == SC_ALPHA_NOALPHA))) { SelectionSegment virtualSpaceRange(SelectionPosition(pdoc->LineEnd(line)), SelectionPosition(pdoc->LineEnd(line), sel.VirtualSpaceFor(pdoc->LineEnd(line)))); for (size_t r=0; r<sel.Count(); r++) { @@ -2607,9 +2596,9 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin if (overrideBackground) { surface->FillRectangle(rcSegment, background); } else if (line < pdoc->LinesTotal() - 1) { - surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back); - } else if (vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].eolFilled) { - surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back); + surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine]].back); + } else if (vsDraw.styles[ll->styles[ll->numCharsInLine]].eolFilled) { + surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine]].back); } else { surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back); } @@ -2629,8 +2618,8 @@ void Editor::DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, Lin } else { if (overrideBackground) { surface->FillRectangle(rcSegment, background); - } else if (vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].eolFilled) { - surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine] & styleMask].back); + } else if (vsDraw.styles[ll->styles[ll->numCharsInLine]].eolFilled) { + surface->FillRectangle(rcSegment, vsDraw.styles[ll->styles[ll->numCharsInLine]].back); } else { surface->FillRectangle(rcSegment, vsDraw.styles[STYLE_DEFAULT].back); } @@ -2672,38 +2661,6 @@ void Editor::DrawIndicators(Surface *surface, ViewStyle &vsDraw, int line, int x const int lineStart = ll->LineStart(subLine); const int posLineEnd = posLineStart + lineEnd; - if (!under) { - // Draw indicators - // foreach indicator... - for (int indicnum = 0, mask = 1 << pdoc->stylingBits; mask < 0x100; indicnum++) { - if (!(mask & ll->styleBitsSet)) { - mask <<= 1; - continue; - } - int startPos = -1; - // foreach style pos in line... - for (int indicPos = lineStart; indicPos <= lineEnd; indicPos++) { - // look for starts... - if (startPos < 0) { - // NOT in indicator run, looking for START - if (indicPos < lineEnd && (ll->indicators[indicPos] & mask)) - startPos = indicPos; - } - // ... or ends - if (startPos >= 0) { - // IN indicator run, looking for END - if (indicPos >= lineEnd || !(ll->indicators[indicPos] & mask)) { - // AT end of indicator run, DRAW it! - DrawIndicator(indicnum, startPos, indicPos, surface, vsDraw, xStart, rcLine, ll, subLine); - // RESET control var - startPos = -1; - } - } - } - mask <<= 1; - } - } - for (Decoration *deco = pdoc->decorations.root; deco; deco = deco->next) { if (under == vsDraw.indicators[deco->indicator].under) { int startPos = posLineStart + lineStart; @@ -6536,7 +6493,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b } bool Editor::PositionIsHotspot(int position) const { - return vs.styles[pdoc->StyleAt(position) & pdoc->stylingBitsMask].hotspot; + return vs.styles[pdoc->StyleAt(position)].hotspot; } bool Editor::PointIsHotspot(Point pt) { @@ -8647,12 +8604,11 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { InvalidateStyleRedraw(); break; case SCI_SETSTYLEBITS: - vs.EnsureStyle((1 << wParam) - 1); - pdoc->SetStylingBits(static_cast<int>(wParam)); + vs.EnsureStyle(0xff); break; case SCI_GETSTYLEBITS: - return pdoc->stylingBits; + return 8; case SCI_SETLINESTATE: return pdoc->SetLineState(static_cast<int>(wParam), static_cast<int>(lParam)); diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx index 2a120c1cf..e425ebe69 100644 --- a/src/PositionCache.cxx +++ b/src/PositionCache.cxx @@ -59,8 +59,6 @@ LineLayout::LineLayout(int maxLineLength_) : edgeColumn(0), chars(0), styles(0), - styleBitsSet(0), - indicators(0), positions(0), hsStart(0), hsEnd(0), @@ -81,7 +79,6 @@ void LineLayout::Resize(int maxLineLength_) { Free(); chars = new char[maxLineLength_ + 1]; styles = new unsigned char[maxLineLength_ + 1]; - indicators = new char[maxLineLength_ + 1]; // Extra position allocated as sometimes the Windows // GetTextExtentExPoint API writes an extra element. positions = new XYPOSITION[maxLineLength_ + 1 + 1]; @@ -94,8 +91,6 @@ void LineLayout::Free() { chars = 0; delete []styles; styles = 0; - delete []indicators; - indicators = 0; delete []positions; positions = 0; delete []lineStarts; diff --git a/src/PositionCache.h b/src/PositionCache.h index d8ea0119d..614c81d38 100644 --- a/src/PositionCache.h +++ b/src/PositionCache.h @@ -39,8 +39,6 @@ public: int edgeColumn; char *chars; unsigned char *styles; - int styleBitsSet; - char *indicators; XYPOSITION *positions; char bracePreviousStyles[2]; diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 9736c52f0..32ad962e8 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -492,7 +492,6 @@ public: void SetLexerLanguage(const char *languageName); const char *DescribeWordListSets(); void SetWordList(int n, const char *wl); - int GetStyleBitsNeeded() const; const char *GetName() const; void *PrivateCall(int operation, void *pointer); const char *PropertyNames(); @@ -594,10 +593,6 @@ void LexState::SetWordList(int n, const char *wl) { } } -int LexState::GetStyleBitsNeeded() const { - return lexCurrent ? lexCurrent->GetStyleBitsNeeded() : 5; -} - const char *LexState::GetName() const { return lexCurrent ? lexCurrent->languageName : ""; } @@ -740,8 +735,7 @@ void ScintillaBase::NotifyStyleToNeeded(int endStyleNeeded) { void ScintillaBase::NotifyLexerChanged(Document *, void *) { #ifdef SCI_LEXER - int bits = DocumentLexState()->GetStyleBitsNeeded(); - vs.EnsureStyle((1 << bits) - 1); + vs.EnsureStyle(0xff); #endif } @@ -982,7 +976,7 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara DocumentLexState()->PrivateCall(wParam, reinterpret_cast<void *>(lParam))); case SCI_GETSTYLEBITSNEEDED: - return DocumentLexState()->GetStyleBitsNeeded(); + return 8; case SCI_PROPERTYNAMES: return StringResult(lParam, DocumentLexState()->PropertyNames()); diff --git a/src/ViewStyle.h b/src/ViewStyle.h index be9d8abfc..4dfb14a33 100644 --- a/src/ViewStyle.h +++ b/src/ViewStyle.h @@ -157,7 +157,7 @@ public: ViewStyle(); ViewStyle(const ViewStyle &source); ~ViewStyle(); - void Init(size_t stylesSize_=64); + void Init(size_t stylesSize_=256); void Refresh(Surface &surface, int tabInChars); void ReleaseAllExtendedStyles(); int AllocateExtendedStyles(int numberStyles); diff --git a/test/simpleTests.py b/test/simpleTests.py index 3ca01f569..2b92d1d66 100644 --- a/test/simpleTests.py +++ b/test/simpleTests.py @@ -57,10 +57,6 @@ class TestSimple(unittest.TestCase): self.ed.StartStyling(0,0xf) self.ed.SetStyling(1, 5) self.assertEquals(self.ed.StyledTextRange(0, 2), b"x\005y\003") - # Set the mask so 0 bit changed but not 2 bit - self.ed.StartStyling(0,0x1) - self.ed.SetStyling(1, 0) - self.assertEquals(self.ed.StyledTextRange(0, 2), b"x\004y\003") self.ed.StartStyling(0,0xff) self.ed.SetStylingEx(2, b"\100\101") |