diff --git a/scintilla/README b/scintilla/README index 9775d7033..45bd3eff9 100644 --- a/scintilla/README +++ b/scintilla/README @@ -44,10 +44,10 @@ The current make file only supports static linking between SciTE and Scintilla. *** Windows version *** -A C++ compiler is required. Visual Studio .NET 2003 is the development system -used for most development although Mingw32 3.1 and Borland C++ are also -supported. -For older versions of Borland make such as version 5.02, add the -l option. +A C++ compiler is required. Visual Studio .NET 2008 is the development system +used for most development although Mingw32 3.1 is also supported. +Borland did work but the command lines are now too long and the most recent +Borland version does not work. For older versions such as version 5.02, add the -l option. To build Scintilla, make in the scintilla/win32 directory cd scintilla\win32 diff --git a/scintilla/doc/ScintillaDoc.html b/scintilla/doc/ScintillaDoc.html index 002d2bd97..ea16a2e47 100644 --- a/scintilla/doc/ScintillaDoc.html +++ b/scintilla/doc/ScintillaDoc.html @@ -116,7 +116,7 @@
There are methods to search for text and for regular expressions. The regular expression support - is limited and should only be used for simple cases and initial development. + is limited and should only be used for simple cases and initial development. A different regular expression + library can be integrated into Scintilla + or can be called from the container using direct access to the buffer contents through + SCI_GETCHARACTERPOINTER.
SCI_FINDTEXT(int flags, TextToFind
*ttf)
@@ -561,7 +564,7 @@ struct TextRange {
SCFIND_POSIX
Treat regular expression in a more POSIX compatible manner
- by interpreting bare ( and ) for tagged sections rather than \( and \).
+ by interpreting bare ( and ) for tagged sections rather than \( and \).
\>
SCI_REPLACETARGET(int length, const char *text)
If length
is -1, text
is a zero terminated string, otherwise
length
sets the number of character to replace the target with.
- After replacement, the target range refers to the replacement text.
- The return value
+ After replacement, the target range refers to the replacement text.
+ The return value
is the length of the replacement string.
Note that the recommended way to delete text in the document is to set the target to the text to be removed,
and to perform a replace target with an empty string.
\1
through \9
replaced by tagged matches from the most recent regular
expression search.
- After replacement, the target range refers to the replacement text.
- The return value is the length of the replacement string.
+ After replacement, the target range refers to the replacement text.
+ The return value is the length of the replacement string.
See also:
@@ -1630,8 +1633,8 @@ struct TextToFind { If you never wish to see it, callSCI_SETHSCROLLBAR(0)
. Use SCI_SETHSCROLLBAR(1)
to enable it again.
SCI_GETHSCROLLBAR
returns the current state. The default state is to display it
- when needed.
- See also: SCI_SETSCROLLWIDTH.
+ when needed.
+ See also:
.SCI_SETVSCROLLBAR(bool visible)
SCI_GETVSCROLLBAR
@@ -1716,7 +1719,7 @@ struct TextToFind {
The effect of using any other wsMode
value is undefined.
SCI_SETWHITESPACEFORE<(bool useWhitespaceForeColour, int SCI_SETWHITESPACEFORE(bool useWhitespaceForeColour, int colour) 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 128
- lexer styles that can be set, numbered 0 to
SCI_SETWHITESPACEBACK(bool useWhitespaceBackColour, int colour)
@@ -1880,8 +1883,8 @@ struct TextToFind {
Style definition
STYLEMAX
(127). Unless you use 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
predefined numbered styles starting at 32, The following STYLE_
* constants are
@@ -1937,8 +1940,8 @@ struct TextToFind {
SCI_SETCONTROLCHARSYMBOL
.STYLE_DEFAULT
.
Use of SCI_CALLTIPUSESTYLE
- causes call tips to use this style instead. Only the font face name, font size,
+ causes call tips to use this style instead. Only the font face name, font size,
foreground and background colours and character set attributes are used.STYLE_MAX
STYLE_LASTPREDEFINED
and STYLE_MAX
would be appropriate
@@ -2036,7 +2039,7 @@ struct TextToFind {
SCI_STYLEGETCHANGEABLE(int styleNumber)SCI_STYLERESETDEFAULT
@@ -2223,7 +2226,7 @@ struct TextToFind {
href="#colour">colour)
SCI_GETCARETFORE
The colour of the caret can be set with SCI_SETCARETFORE
and retrieved with
- SCI_CETCARETFORE
.
SCI_GETCARETFORE
.
SCI_SETCARETLINEVISIBLE(bool show)
SCI_GETCARETLINEVISIBLE
@@ -2239,11 +2242,11 @@ struct TextToFind {
The two SCI_GETCARET*
functions return the state and the colour. This form of
background colouring has highest priority when a line has markers that would otherwise change
the background colour.
- The caret line may also be drawn translucently which allows other background colours to show
- through. This is done by setting the alpha (translucency) value by calling
- SCI_SETCARETLINEBACKALPHA. When the alpha is not SC_ALPHA_NOALPHA,
- the caret line is drawn after all other features so will affect the colour of all other features.
-
SCI_SETCARETPERIOD(int milliseconds)
SCI_GETCARETPERIOD
@@ -2428,6 +2431,8 @@ struct TextToFind {
+
+
SCI_SETCHARSDEFAULT
Use the default sets of word and whitespace characters. This sets whitespace to space, tab and other
characters with codes less than 0x20, with word characters set to alphanumeric and '_'.
@@ -2550,7 +2561,7 @@ struct TextToFind {
SCI_SETFOCUS(bool focus)
SCI_GETFOCUS
Scintilla can be told to grab the focus with this message. This is needed more on GTK+ where
- focus handling is more complicated than on Windows.
The internal focus flag can be set with SCI_SETFOCUS
. This is used by clients
that have complex focus requirements such as having their own window that gets the real focus
@@ -2639,14 +2650,13 @@ struct TextToFind {
(0) to create all tabs and indents out of spaces. The default is true
. You can use
to get the column of a
position taking the width of a tab into account.
SCI_SETINDENT(int widthInChars)
SCI_GETINDENT
SCI_SETINDENT
sets the size of indentation in terms of the width of a space in . If you set a width of
0, the indent size is the same as the tab size. There are no limits on indent sizes, but values
- less than 0 or large values may have undesirable effects.
-
-
+ less than 0 or large values may have undesirable effects.
+
SCI_SETTABINDENTS(bool tabIndents)
SCI_GETTABINDENTS
@@ -2693,16 +2703,16 @@ struct TextToFind {
SC_IV_LOOKFORWARD
SC_IV_LOOKBOTH
SC_MARK_FULLRECT
.
The SC_MARK_BACKGROUND
marker changes the background colour of the line only.
- The SC_MARK_FULLRECT
symbol mirrors this, changing only the margin background colour.
+ The SC_MARK_FULLRECT
symbol mirrors this, changing only the margin background colour.
The SC_MARK_EMPTY
symbol is invisible, allowing client code to track the movement
of lines. You would also use it if you changed the folding style and wanted one or more of the
SC_FOLDERNUM_
* markers to have no associated symbol.
SCI_SETSTYLING
with the values
INDIC0_MASK
, INDIC1_MASK
and INDIC2_MASK
.
- If you are using indicators in a buffer that has a lexer active
- (see 0x1f
in the default layout of 5 style bits and 3 indicator bits)
- when you are done.
If you are using indicators in a buffer that has a lexer active
+ (see 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 7 bits. The remaining bits @@ -3421,7 +3431,7 @@ struct TextToFind {The mouse may be clicked on call tips and this causes a
- notification to be sent to the container. Small up an down arrows may be displayed within
+ notification to be sent to the container. Small up and down arrows may be displayed within
a call tip by, respectively, including the characters '\001', or '\002'. This is useful
for showing that there are overloaded variants of one function name and that the user can
click on the arrows to cycle through the overloads.
SCI_GETDIRECTFUNCTION
SCI_GETDIRECTPOINTER
+ SCI_GETCHARACTERPOINTER
On Windows, the message-passing scheme used to communicate between the container and @@ -4023,6 +4034,25 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ this once for each Scintilla window you create. When you call the direct function, you must pass in the direct pointer associated with the target window.
+SCI_GETCHARACTERPOINTER
+ Move the gap within Scintilla so that the text of the document is stored consecutively
+ and ensure there is a NUL character after the text, then return a pointer to the first character.
+ Applications may then pass this to a function that accepts a character pointer such as a regular
+ expression search or a parser. The pointer should not be written to as that may desynchronize
+ the internal state of Scintilla.
Since any action in Scintilla may change its internal state + this pointer becomes invalid after any call or by allowing user interface activity. The application + should reacquire the pointer after making any call to Scintilla or performing any user-interface calls such + as modifying a progress indicator.
+This call takes similar time to inserting a character at the end of the document and this may
+ include moving the document contents. Specifically, all the characters after the document gap
+ are moved to before the gap. This compacted state should persist over calls and user interface
+ actions that do not change the document contents so reacquiring the pointer afterwards is very
+ quick. If this call is used to implement a global replace operation, then each replacement will
+ move the gap so if SCI_GETCHARACTERPOINTER
is called after
+ each replacement then the operation will become O(n^2) rather than O(n). Instead, all
+ matches should be found and remembered, then all the replacements performed.
A Scintilla window and the document that it displays are separate entities. When you create @@ -4148,7 +4178,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ The first two messages mark a range of lines as visible or invisible and then redraw the display. The third message reports on the visible state of a line and returns 1 if it is visible and 0 if it is not visible. These messages have no effect on fold levels or fold - flags.
+ flags. The first line can not be hidden.SCI_SETFOLDLEVEL(int line, int level)
SCI_GETFOLDLEVEL(int line)
@@ -4278,6 +4308,8 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
+
+
@@ -4295,10 +4327,10 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
style is wider than the window then the break occurs after the last character that completely
fits on the line. The horizontal scroll bar does not appear when wrap mode is on.
For wrapped lines Scintilla can draw visual flags (little arrows) at end of a a subline of a - wrapped line and at begin of the next subline. These can be enabled individually, but if Scintilla - draws the visual flag at begin of the next subline this subline will be indented by one char. - Independent from drawing a visual flag at the begin the subline can have an indention.
+For wrapped lines Scintilla can draw visual flags (little arrows) at end of a a subline of a + wrapped line and at begin of the next subline. These can be enabled individually, but if Scintilla + draws the visual flag at begin of the next subline this subline will be indented by one char. + Independent from drawing a visual flag at the begin the subline can have an indention.
Much of the time used by Scintilla is spent on laying out and drawing text. The same text layout calculations may be performed many times even when the data used in these calculations @@ -4331,8 +4363,8 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
SCI_SETWRAPVISUALFLAGS(int wrapVisualFlags)
SCI_GETWRAPVISUALFLAGS
- You can enable the drawing of visual flags to indicate a line is wrapped. Bits set in
- wrapVisualFlags determine which visual flags are drawn.
+ You can enable the drawing of visual flags to indicate a line is wrapped. Bits set in
+ wrapVisualFlags determine which visual flags are drawn.
SC_WRAPVISUALFLAG_START |
2 | Visual flag at begin of subline of a wrapped line. - Subline is indented by at least 1 to make room for the flag. - |
+ Subline is indented by at least 1 to make room for the flag.
SCI_SETWRAPVISUALFLAGSLOCATION(int wrapVisualFlagsLocation)
SCI_GETWRAPVISUALFLAGSLOCATION
- You can set wether the visual flags to indicate a line is wrapped are drawn near the border or near the text.
- Bits set in wrapVisualFlagsLocation set the location to near the text for the corresponding visual flag.
+ You can set wether the visual flags to indicate a line is wrapped are drawn near the border or near the text.
+ Bits set in wrapVisualFlagsLocation set the location to near the text for the corresponding visual flag.
SCI_SETWRAPSTARTINDENT(int indent)
SCI_GETWRAPSTARTINDENT
SCI_SETWRAPSTARTINDENT
sets the size of indentation of sublines for
- wrapped lines in terms of the width of a space in
- .
- There are no limits on indent sizes, but values less than 0 or large values may have
- undesirable effects.
- The indention of sublines is independent of visual flags, but if
- SC_WRAPVISUALFLAG_START
is set an indent of at least 1 is used.
+ wrapped lines in terms of the width of a space in
+ .
+ There are no limits on indent sizes, but values less than 0 or large values may have
+ undesirable effects.
+ The indention of sublines is independent of visual flags, but if
+ SC_WRAPVISUALFLAG_START
is set an indent of at least 1 is used.
SCI_SETLAYOUTCACHE(int cacheMode)
@@ -4463,7 +4494,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
-
+
SCI_SETPOSITIONCACHE(int size)
SCI_GETPOSITIONCACHE
@@ -4557,7 +4588,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
of a space character in , so it may not work very well if
your styles use proportional fonts or if your style have varied font sizes or you use a
- mixture of bold, italic and normal text. .
+ mixture of bold, italic and normal text.
SCI_SETEDGECOLUMN(int column)
SCI_GETEDGECOLUMN
@@ -4670,6 +4698,10 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
interpreted as integers. Search the lexer sources for GetPropertyInt
to see how
properties are used.
There is a convention for naming properties used by lexers so that the set of properties can be found by scripts. + Property names should start with "lexer.<lexer>." or "fold.<lexer>." when they apply to one + lexer or start with "lexer." or "fold." if they apply to multiple lexers.
+SCI_GETPROPERTY(const char *key, char *value)
Lookup a keyword:value pair using the specified key; if found, copy the value to the user-supplied
buffer and return the length (not including the terminating 0). If not found, copy an empty string
@@ -4736,7 +4768,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
struct NotifyHeader { // This matches the Win32 NMHDR structure void *hwndFrom; // environment specific window handle/pointer - uptr_t idFrom; // CtrlID of the window issuing the notification + uptr_t idFrom; // CtrlID of the window issuing the notification unsigned int code; // The SCN_* notification code }; @@ -4791,6 +4823,7 @@ struct SCNotification { SCN_INDICATORRELEASE
SCN_CALLTIPCLICK
SCN_AUTOCSELECTION
+ SCN_AUTOCCANCELLED
The following
@@ -4831,8 +4864,8 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber); character) that is entered into the text. The container can use this to decide to display a call tip or an auto completion list. The character is inSCI_*
messages are associated with these notifications:SCNotification.ch
. - This notification is sent before the character has been styled so processing that depends on - styling should instead be performed in the SCN_UPDATEUI notification. + This notification is sent before the character has been styled so processing that depends on + styling should instead be performed in the SCN_UPDATEUI notification.SCN_SAVEPOINTREACHED
SCN_SAVEPOINTLEFT
@@ -4919,8 +4952,8 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber);Valid for text changes, not for style changes. If we are collecting undo information this holds a pointer to the text that is handed to the Undo system, otherwise it is zero. For user performed SC_MOD_BEFOREDELETE the text field is 0 and - for user performed SC_MOD_BEFOREINSERT the text field points to an array of cells, - not bytes and the length is the number of cells. + for user performed SC_MOD_BEFOREINSERT the text field points to an array of cells, + not bytes and the length is the number of cells.@@ -5101,7 +5134,7 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber); @@ -5122,11 +5155,11 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber);0x8000 A line state has changed because SCI_SETLINESTATE - was called. + was called.line
0x2000 This is set on a SC_PERFORMED_USER action when it is the - first or only step in an undo transaction. This can be used to integrate the Scintilla - undo stack with an undo stack in the container application by adding a Scintilla - action to the container's stack for the currently opened container transaction or - to open a new container transaction if there is no open container transaction. - + first or only step in an undo transaction. This can be used to integrate the Scintilla + undo stack with an undo stack in the container application by adding a Scintilla + action to the container's stack for the currently opened container transaction or + to open a new container transaction if there is no open container transaction. +None @@ -5426,9 +5459,13 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next +SCN_AUTOCCANCELLED
+ The user has cancelled an autocompletion list. + There is no other information in SCNotification. +GTK+
On GTK+, the following functions create a Scintilla widget, communicate with it and allow - resources to be released after all Scintilla widgets hace been destroyed.
+ resources to be released after all Scintilla widgets have been destroyed.GtkWidget *scintilla_new()
void scintilla_set_id(ScintillaObject *sci, uptr_t id)
sptr_t scintilla_send_message(ScintillaObject *sci,unsigned int iMessage, uptr_t wParam, sptr_t lParam)
@@ -5589,7 +5626,16 @@ EM_SETTARGETDEVICE following the patterns of other lexers. The important thing is to includeLINK_LEXER(lmMyLexer);
to correspond with theLexerModule lmMyLexer(...);
in your lexer source code. + +Building with an alternative Regular Expression implementation
+ +A simple interface provides support for switching the Regular Expressions engine at + compile time. You must implement
+RegexSearchBase
for your chosen engine, + look at the built-in implementationBuiltinRegex
to see how this is done. + You then need to implement the factory methodCreateRegexSearch
+ to create an instance of your class. You must disable the built-in implementation by defining +SCI_OWNREGEX
.