From c813c65a565f815d7d01f10d1518f4571a31f45f Mon Sep 17 00:00:00 2001
From: Neil Each byte in a Scintilla document is followed by an associated byte of styling
+ 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
-
- and related calls.
- The default split is with the index in the low 5 bits and 3 high bits as indicators. 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 up to a maximum of 8 bits.
- The remaining bits can be used for indicators.
+
+ Release 3.4.3
+
+
+
Release 3.4.2
diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
index 7fe680991..e8b705b1f 100644
--- a/lexers/LexCPP.cxx
+++ b/lexers/LexCPP.cxx
@@ -821,10 +821,18 @@ void SCI_METHOD LexerCPP::Lex(unsigned int startPos, int length, int initStyle,
((lenS == 1) && ((s[0] == 'L') || (s[0] == 'u') || (s[0] == 'U'))) ||
((lenS == 2) && literalString && (s[0] == 'u') && (s[1] == '8'));
if (valid) {
- if (literalString)
- sc.ChangeState((raw ? SCE_C_STRINGRAW : SCE_C_STRING)|activitySet);
- else
+ if (literalString) {
+ if (raw) {
+ // Set the style of the string prefix to SCE_C_STRINGRAW but then change to
+ // SCE_C_DEFAULT as that allows the raw string start code to run.
+ sc.ChangeState(SCE_C_STRINGRAW|activitySet);
+ sc.SetState(SCE_C_DEFAULT|activitySet);
+ } else {
+ sc.ChangeState(SCE_C_STRING|activitySet);
+ }
+ } else {
sc.ChangeState(SCE_C_CHARACTER|activitySet);
+ }
} else {
sc.SetState(SCE_C_DEFAULT | activitySet);
}
--
cgit v1.2.3
From f84a69d28698468076c0abc82fe9bb3ddf060a68 Mon Sep 17 00:00:00 2001
From: Neil Text retrieval and modification
-
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.
@@ -421,8 +410,6 @@ SCI_GETSTYLEAT(int position)pos in the document, or 0 if pos is
negative or past the end of the document.
- SCI_SETSTYLEBITS(int bits)
- SCI_GETSTYLEBITS
- 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 SCI_SETSTYLEBITS(5).
- The number of styling bits needed by the current lexer can be found with
- .
SCI_RELEASEALLEXTENDEDSTYLES
SCI_ALLOCATEEXTENDEDSTYLES(int numberStyles)
Extended styles are used for features like textual margins and annotations as well as internally by Scintilla.
@@ -2329,12 +2308,7 @@ struct Sci_TextToFind {
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 = styles 0 to 31) that set a style and three bits (5 to 7) that - define indicators. You can change the balance between - styles and indicators with . If your styling needs can be met by +
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 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.
SCI_GETENDSTYLED
- SCI_STARTSTYLING(int position, int mask)
+ SCI_STARTSTYLING(int position, int unused)
SCI_SETSTYLING(int length, int style)
SCI_SETSTYLINGEX(int length, const char
*styles)
@@ -2363,31 +2337,23 @@ struct Sci_TextToFind {
container. The container can send SCI_GETENDSTYLED to work out where it needs to
start styling. Scintilla will always ask to style whole lines.
- SCI_STARTSTYLING(int pos, int mask)
- This prepares for styling by setting the styling position pos to start at and a
- mask 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 mask value
- of 31 (0x1f) if you were setting text styles and did not want to change the indicators. After
+
SCI_STARTSTYLING(int pos, int unused)
+ This prepares for styling by setting the styling position pos to start at.
+ The unused argument was used in earlier versions but is now ignored.
+ After
SCI_STARTSTYLING, send multiple SCI_SETSTYLING messages for each
lexical entity to style.
SCI_SETSTYLING(int length, int style)
This message sets the style of length characters starting at the styling position
- and then increases the styling position by length, ready for the next call. If
- sCell is the style byte, the operation is:
- if ((sCell & mask) != style) sCell = (sCell & ~mask) | (style &
- mask);
+ and then increases the styling position by length, ready for the next call.
SCI_SETSTYLINGEX(int length, const char *styles)
As an alternative to SCI_SETSTYLING, which applies the same style to each byte,
you can use this message which specifies the styles for each of length bytes from
the styling position and then increases the styling position by length, ready for
- the next call. The length styling bytes pointed at by styles should
- not contain any bits not set in mask.
+ the next call.
SCI_SETLINESTATE(int line, int value)
SCI_GETLINESTATE(int line)
@@ -2405,9 +2371,8 @@ struct Sci_TextToFind {
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 STYLE_MAX (255). Unless you use 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 STYLE_MAX (255).
+ There are also some
predefined numbered styles starting at 32, The following STYLE_* constants are
defined.
@@ -2504,9 +2469,7 @@ struct Sci_TextToFind {
255
This is not a style but is the number of the maximum style that can be set. Styles
- between STYLE_LASTPREDEFINED and STYLE_MAX would be appropriate
- if you used SCI_SETSTYLEBITS
- to set more than 5 style bits.
+ between STYLE_LASTPREDEFINED and STYLE_MAX may be used.
@@ -3196,9 +3159,6 @@ struct Sci_TextToFind {
Other settings
- SCI_SETUSEPALETTE(bool
- allowPaletteUse)
- SCI_GETUSEPALETTE
SCI_SETBUFFEREDDRAW(bool isBuffered)
SCI_GETBUFFEREDDRAW
SCI_SETTWOPHASEDRAW(bool twoPhase)
@@ -3839,10 +3799,7 @@ struct Sci_TextToFind {
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.
+ by drawing underlines under text or boxes around text.
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.
@@ -3853,6 +3810,12 @@ struct Sci_TextToFind {
by lexers (0..7) and a range for use by containers
(8=INDIC_CONTAINER .. 31=INDIC_MAX).
+ Originally, Scintilla used a different technique for indicators but this
+ has been removed
+ and the APIs perform no action.
+ While both techniques were supported, the term "modern indicators" was used for the
+ newer implementation.
+
SCI_INDICSETSTYLE(int indicatorNumber, int
indicatorStyle)
SCI_INDICGETSTYLE(int indicatorNumber)
@@ -4074,12 +4037,10 @@ struct Sci_TextToFind {
SCI_INDICSETUNDER(int indicatorNumber, bool under)
SCI_INDICGETUNDER(int indicatorNumber)
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
+ Drawing under text works only for indicators when
is enabled.
- Modern Indicators
-
- Modern indicators are stored in a format similar to run length encoding which is efficient in both
+
Indicators are stored in a format similar to run length encoding which is efficient in both
speed and storage for sparse information.
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.
@@ -4146,32 +4107,8 @@ struct Sci_TextToFind {
This message hides the find indicator.
- Style Byte Indicators (deprecated)
- 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.
-
- The indicators are set using with a INDICS_MASK mask
- and with the values
- INDIC0_MASK, INDIC1_MASK and INDIC2_MASK.
-
- If you are using indicators in a buffer that has a lexer active
- (see ),
- you must save lexing state information before setting any indicators and restore it afterwards.
- Use
- to retrieve the current "styled to" position and
-
- to reset the styling position and mask (0x1f in the default layout of 5 style bits and 3 indicator bits)
- when you are done.
-
- The number of bits used for styles can be altered with from 0 to 8 bits. The remaining bits
- can be used for indicators, so there can be from 1 to 8 indicators. However, the
- INDIC*_MASK constants defined in Scintilla.h all assume 5 bits of
- styling information and 3 indicators. If you use a different arrangement, you must define your
- own constants.
+ Earlier versions of Scintilla allowed partitioning style bytes
+ between style numbers and indicators and provided APIs for setting and querying this.
Autocompletion
@@ -5968,7 +5905,6 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
SCI_DESCRIBEKEYWORDSETS(<unused>, char *descriptions)
SCI_SETKEYWORDS(int keyWordSet, const char
*keyWordList)
- SCI_GETSTYLEBITSNEEDED
SCI_GETSUBSTYLEBASES(<unused>, char *styles)
SCI_DISTANCETOSECONDARYSTYLES
@@ -6118,11 +6054,6 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
SCI_DESCRIBEKEYWORDSETS(<unused>, char *descriptions)
A description of all of the keyword sets separated by "\n" is returned by SCI_DESCRIBEKEYWORDSETS.
- SCI_GETSTYLEBITSNEEDED
- Retrieve the number of bits the current lexer needs for styling. This should normally be the argument
- to .
-
-
Substyles
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 #define BEOS 0 to #defin
document. The lexer can call ChangeLexerState to signal to
the document that it should relex and display more.
+For StartStyling the mask argument has no effect. It was used in version 3.4.2 and earlier.
+
SetErrorStatus 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
SCI_GETUSEPALETTE Deprecated
Scintilla no longer supports palette mode. The last version to support palettes was 2.29.
Any calls to these methods should be removed.
+
+ The following are features that should be removed from calling code but are still
+ defined to avoid breaking callers.
+
+ SCI_SETSTYLEBITS(int bits) Deprecated
+ SCI_GETSTYLEBITS Deprecated
+ SCI_GETSTYLEBITSNEEDED Deprecated
+ INDIC0_MASK, INDIC1_MASK, INDIC2_MASK, INDICS_MASK Deprecated
+ 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 standard indicators.
+ SCI_GETSTYLEBITS and SCI_GETSTYLEBITSNEEDED always return 8,
+ indicating that 8 bits are used for styling and there are 256 styles.
+
+
Edit messages never supported by Scintilla
@@ -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.
+ Removed features
+
+ 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 standard indicators.
+
Building Scintilla
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(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(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(pAccess->StyleAt(position) & mask);
+ return static_cast(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(chAttr));
} else {
- if (chAttr != chWhile)
- chFlags = 0;
- chAttr = static_cast(chAttr | chFlags);
for (unsigned int i = startSeg; i <= pos; i++) {
assert((startPosStyling + validLen) < Length());
styleBuf[validLen++] = static_cast(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((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((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(StyleAt(position) & stylingBitsMask);
+ char styBrace = static_cast(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(StyleAt(position) & stylingBitsMask);
+ char styAtPos = static_cast(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(styleByte & styleMask));
- allSame = allSame &&
- (ll->indicators[numCharsInLine] == static_cast(styleByte & ~styleMask));
+ (ll->styles[numCharsInLine] == static_cast(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(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; charInLinechars[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; rFillRectangle(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(wParam));
+ vs.EnsureStyle(0xff);
break;
case SCI_GETSTYLEBITS:
- return pdoc->stylingBits;
+ return 8;
case SCI_SETLINESTATE:
return pdoc->SetLineState(static_cast(wParam), static_cast(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(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")
--
cgit v1.2.3
From aba660e18c19beaada7cc75c21a81760c0ee976e Mon Sep 17 00:00:00 2001
From: Neil
Date: Sat, 24 May 2014 09:39:22 +1000
Subject: Remove suppression that is no longer needed.
---
cppcheck.suppress | 1 -
1 file changed, 1 deletion(-)
diff --git a/cppcheck.suppress b/cppcheck.suppress
index 483822454..10bf9dbf3 100644
--- a/cppcheck.suppress
+++ b/cppcheck.suppress
@@ -26,7 +26,6 @@ variableScope:scintilla/lexers/LexOpal.cxx
variableScope:scintilla/lexers/LexOthers.cxx
variableScope:scintilla/lexers/LexPB.cxx
noCopyConstructor:scintilla/lexers/LexPerl.cxx
-variableScope:scintilla/lexers/LexPS.cxx
variableScope:scintilla/lexers/LexRuby.cxx
uninitMemberVar:scintilla/lexers/LexRuby.cxx
variableScope:scintilla/lexers/LexSpecman.cxx
--
cgit v1.2.3
From 0e25a153a1970e5b895072f265c02bac9fd7f3fa Mon Sep 17 00:00:00 2001
From: Neil
Date: Sat, 24 May 2014 10:20:06 +1000
Subject: SCI_AUTOCSETMULTI allows setting whether autocompletion text is
inserted at each selection when multiple selections are active. From Mitchell
Foral.
---
doc/ScintillaDoc.html | 10 +++++++++-
doc/ScintillaHistory.html | 4 ++++
include/Scintilla.h | 4 ++++
include/Scintilla.iface | 10 ++++++++++
src/ScintillaBase.cxx | 34 +++++++++++++++++++++++++++++++---
src/ScintillaBase.h | 1 +
6 files changed, 59 insertions(+), 4 deletions(-)
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index e0880b071..7187eeb24 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -82,7 +82,7 @@
Scintilla Documentation
- Last edited 1 May 2014 NH
+ Last edited 24 May 2014 NH
There is an overview of the internal design of
Scintilla.
@@ -4160,6 +4160,8 @@ struct Sci_TextToFind {
+
+
@@ -4277,6 +4279,12 @@ struct Sci_TextToFind {
This corresponds to a behaviour property of SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE (0).
If you want autocompletion to ignore case at all, choose SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE (1).
+ SCI_AUTOCSETMULTI(int multi)
+ SCI_AUTOCGETMULTI
+ When autocompleting with multiple selections present, the autocompleted text can go into just the main selection with
+ SC_MULTIAUTOC_ONCE (0) or into each selection with SC_MULTIAUTOC_EACH (1).
+ The default is SC_MULTIAUTOC_ONCE.
+
SCI_AUTOCSETORDER(int order)
SCI_AUTOCGETORDER
The default setting SC_ORDER_PRESORTED (0) requires that the list be provided in alphabetical sorted order.
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index f23191ff2..78cbeaa5d 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -467,6 +467,10 @@
Released 22 May 2014.
+ When multiple selections are active, autocompletion text may be inserted at each selection with new
+ SCI_AUTOCSETMULTI method.
+
+
C++ lexer fixes raw string recognition so that R"xxx(blah)xxx" is styled as SCE_C_STRINGRAW.
diff --git a/include/Scintilla.h b/include/Scintilla.h
index f8744c1c0..9bb0ca905 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -717,6 +717,10 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_CASEINSENSITIVEBEHAVIOUR_IGNORECASE 1
#define SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR 2634
#define SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR 2635
+#define SC_MULTIAUTOC_ONCE 0
+#define SC_MULTIAUTOC_EACH 1
+#define SCI_AUTOCSETMULTI 2636
+#define SCI_AUTOCGETMULTI 2637
#define SC_ORDER_PRESORTED 0
#define SC_ORDER_PERFORMSORT 1
#define SC_ORDER_CUSTOM 2
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index f6b17bca8..3e5f51b9c 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -1884,6 +1884,16 @@ set void AutoCSetCaseInsensitiveBehaviour=2634(int behaviour,)
# Get auto-completion case insensitive behaviour.
get int AutoCGetCaseInsensitiveBehaviour=2635(,)
+enu MultiAutoComplete=SC_MULTIAUTOC_
+val SC_MULTIAUTOC_ONCE=0
+val SC_MULTIAUTOC_EACH=1
+
+# Change the effect of autocompleting when there are multiple selections.
+set void AutoCSetMulti=2636(int multi,)
+
+# Retrieve the effect of autocompleting when there are multiple selections..
+get int AutoCGetMulti=2637(,)
+
enu Ordering=SC_ORDER_
val SC_ORDER_PRESORTED=0
val SC_ORDER_PERFORMSORT=1
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 32ad962e8..e39b5e2a8 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -57,6 +57,7 @@ ScintillaBase::ScintillaBase() {
displayPopupMenu = true;
listType = 0;
maxListWidth = 0;
+ multiAutoCMode = SC_MULTIAUTOC_ONCE;
}
ScintillaBase::~ScintillaBase() {
@@ -197,9 +198,29 @@ void ScintillaBase::AutoCompleteDoubleClick(void *p) {
void ScintillaBase::AutoCompleteInsert(Position startPos, int removeLen, const char *text, int textLen) {
UndoGroup ug(pdoc);
- pdoc->DeleteChars(startPos, removeLen);
- const int lengthInserted = pdoc->InsertString(startPos, text, textLen);
- SetEmptySelection(startPos + lengthInserted);
+ if (multiAutoCMode == SC_MULTIAUTOC_ONCE) {
+ pdoc->DeleteChars(startPos, removeLen);
+ const int lengthInserted = pdoc->InsertString(startPos, text, textLen);
+ SetEmptySelection(startPos + lengthInserted);
+ } else {
+ // SC_MULTIAUTOC_EACH
+ for (size_t r=0; r= 0) {
+ pdoc->DeleteChars(positionInsert - removeLen, removeLen);
+ }
+ const int lengthInserted = pdoc->InsertString(positionInsert, text, textLen);
+ if (lengthInserted > 0) {
+ sel.Range(r).caret.SetPosition(positionInsert + lengthInserted);
+ sel.Range(r).anchor.SetPosition(positionInsert + lengthInserted);
+ }
+ sel.Range(r).ClearVirtualSpace();
+ }
+ }
+ }
}
void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
@@ -813,6 +834,13 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
case SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR:
return ac.ignoreCaseBehaviour;
+ case SCI_AUTOCSETMULTI:
+ multiAutoCMode = static_cast(wParam);
+ break;
+
+ case SCI_AUTOCGETMULTI:
+ return multiAutoCMode;
+
case SCI_AUTOCSETORDER:
ac.autoSort = static_cast(wParam);
break;
diff --git a/src/ScintillaBase.h b/src/ScintillaBase.h
index 59ffea41e..8440ebecc 100644
--- a/src/ScintillaBase.h
+++ b/src/ScintillaBase.h
@@ -46,6 +46,7 @@ protected:
int listType; ///< 0 is an autocomplete list
int maxListWidth; /// Maximum width of list, in average character widths
+ int multiAutoCMode; /// Mode for autocompleting when multiple selections are present
#ifdef SCI_LEXER
LexState *DocumentLexState();
--
cgit v1.2.3
From b0296d86a48642f2f381c3e0b11a022482ae25e3 Mon Sep 17 00:00:00 2001
From: Neil
Date: Sat, 24 May 2014 15:15:49 +1000
Subject: Header include statements are now in a standardised order with that
order defined in scripts/HeaderOrder.txt.
---
cocoa/PlatCocoa.h | 8 +--
cocoa/PlatCocoa.mm | 20 ++++---
cocoa/ScintillaCocoa.h | 8 +--
gtk/ScintillaGTK.cxx | 28 +++++-----
lexers/LexCPP.cxx | 2 +-
lexers/LexDMIS.cxx | 6 +-
lexers/LexECL.cxx | 2 +-
lexers/LexEScript.cxx | 2 +-
lexers/LexHaskell.cxx | 2 +-
lexers/LexRust.cxx | 2 +-
lexers/LexSpecman.cxx | 2 +-
lexers/LexVHDL.cxx | 2 +-
lexers/LexVisualProlog.cxx | 2 +-
lexlib/Accessor.cxx | 2 +-
lexlib/CharacterSet.cxx | 2 +-
lexlib/LexerBase.cxx | 2 +-
lexlib/LexerModule.cxx | 2 +-
lexlib/LexerNoExceptions.cxx | 2 +-
lexlib/LexerSimple.cxx | 2 +-
lexlib/StyleContext.cxx | 2 +-
lexlib/WordList.cxx | 2 +-
scripts/HeaderOrder.txt | 128 +++++++++++++++++++++++++++++++++++++++++++
src/CaseFolder.cxx | 2 +-
src/Catalogue.cxx | 2 +-
src/Document.cxx | 4 +-
src/Editor.cxx | 2 +-
src/ExternalLexer.cxx | 2 +-
src/Indicator.cxx | 2 +-
src/PositionCache.cxx | 2 +-
src/ScintillaBase.cxx | 11 +++-
win32/PlatWin.cxx | 2 +-
win32/ScintillaWin.cxx | 23 ++++----
32 files changed, 210 insertions(+), 72 deletions(-)
create mode 100644 scripts/HeaderOrder.txt
diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h
index 06b7a1f5b..60977c92e 100644
--- a/cocoa/PlatCocoa.h
+++ b/cocoa/PlatCocoa.h
@@ -7,14 +7,14 @@
#ifndef PLATCOCOA_H
#define PLATCOCOA_H
-#include
-#include
-#include
-
#include
#include
+#include
+#include
+#include
+
#include
#include "QuartzTextLayout.h"
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index a0a0e8943..2225631a6 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -12,25 +12,27 @@
* This file is dual licensed under LGPL v2.1 and the Scintilla license (http://www.scintilla.org/License.txt).
*/
-#import "Platform.h"
-#import "ScintillaView.h"
-#import "ScintillaCocoa.h"
-#import "PlatCocoa.h"
+#include
+#include
+#include
#include
#include
-#include
-#include
-#include
+
#include
#include
#include