From 850b6902374368e7f49c8d359589cbbf1b54a922 Mon Sep 17 00:00:00 2001
From: donho Last edited 4/February/2006 NH Last edited 20/June/2007 NH There is an overview of the internal design of
Scintilla. Each character in a Scintilla document is followed by an associated byte of styling
information. The combination of a character byte and a style byte is called a cell. Style bytes
- are interpreted as a style index in the low 5 bits and as 3 individual bits of SCI_INDICATORFILLRANGE
+ 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
@@ -508,6 +513,10 @@ struct TextRange {
+ 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.
+ Scintilla Documentation
-
@@ -279,7 +279,12 @@
Searching
+
@@ -822,6 +832,7 @@ struct TextToFind {
SCI_PASTE
@@ -813,6 +822,7 @@ struct TextToFind {
+
SCI_CLEAR
SCI_CANPASTE
+ SCI_COPYALLOWLINE
These commands perform the standard tasks of cutting and copying data to the clipboard,
pasting from the clipboard into the document, and clearing the document.
SCI_CANPASTE
returns non-zero if the document isn't read-only and if the selection
@@ -836,6 +847,11 @@ struct TextToFind {
the destination and source applications. Data from SCI_PASTE will not arrive in the
document immediately.
SCI_COPYALLOWLINE
works the same as SCI_COPY except that if the
+ selection is empty then the current line is copied. On Windows, an extra "MSDEVLineSelect" marker
+ is added to the clipboard which is then used in SCI_PASTE
to paste
+ the whole line before the current line.
SCI_COPYRANGE
copies a range of text from the document to
@@ -1328,6 +1344,8 @@ struct TextToFind {
+
+
@@ -1634,7 +1652,14 @@ struct TextToFind {
For performance, Scintilla does not measure the display width of the document to determine
the properties of the horizontal scroll bar. Instead, an assumed width is used.
These messages set and get the document width in pixels assumed by Scintilla.
- The default value is 2000.
SCI_SETSCROLLWIDTHTRACKING
+
+ SCI_SETSCROLLWIDTHTRACKING(bool tracking)
+ SCI_GETSCROLLWIDTHTRACKING
+ If scroll width tracking is enabled then the scroll width is adjusted to ensure that all of the lines currently
+ displayed can be completely scrolled. This mode never adjusts the scroll width to be narrower.
SCI_SETENDATLASTLINE(bool endAtLastLine)
SCI_GETENDATLASTLINE
@@ -1845,7 +1870,9 @@ struct TextToFind {
As well as the 8 bits of lexical state stored for each character there is also an integer
stored for each line. This can be used for longer lived parse states such as what the current
scripting language is in an ASP page. Use SCI_SETLINESTATE
to set the integer
- value and SCI_GETLINESTATE
to get the value.
SCI_GETLINESTATE
to get the value.
+ Changing the value produces a SC_MOD_CHANGELINESTATE notification.
+
SCI_GETMAXLINESTATE
This returns the last line that has any line state.
SCI_SETSELFORE(bool useSelectionForeColour,
+ SCI_SETSELFORE(bool useSelectionForeColour,
int colour)
SCI_SETSELBACK(bool useSelectionBackColour,
int colour)
@@ -2153,9 +2180,11 @@ struct TextToFind {
SCI_GETCARETLINEBACKALPHA
SCI_SETCARETPERIOD(int milliseconds)
SCI_GETCARETPERIOD
+ SCI_SETCARETSTYLE(int style)
+ SCI_GETCARETSTYLE
SCI_SETCARETWIDTH(int pixels)
SCI_GETCARETWIDTH
- SCI_SETHOTSPOTACTIVEFORE(bool useSetting,
+ SCI_SETHOTSPOTACTIVEFORE(bool useSetting,
int colour)
SCI_GETHOTSPOTACTIVEFORE
SCI_SETHOTSPOTACTIVEBACK(bool useSetting,
@@ -2223,12 +2252,26 @@ struct TextToFind {
state. Setting the period to 0 stops the caret blinking. The default value is 500 milliseconds.
SCI_GETCARETPERIOD
returns the current setting.
+ SCI_SETCARETSTYLE(int style)
+ SCI_GETCARETSTYLE
+ The style of the caret can be set with SCI_SETCARETSTYLE
to be a line caret
+ (CARETSTYLE_LINE=1), a block caret (CARETSTYLE_BLOCK=2) or to not draw at all
+ (CARETSTYLE_INVISIBLE=0). The default value is the line caret (CARETSTYLE_LINE=1).
+ You can determine the current caret style setting using SCI_GETCARETSTYLE
.
+
+ The block character draws most combining and multibyte character sequences successfully,
+ though some fonts like Thai Fonts (and possibly others) can sometimes appear strange when
+ the cursor is positioned at these characters, which may result in only drawing a part of the
+ cursor character sequence. This is most notable on Windows platforms.
+
SCI_SETCARETWIDTH(int pixels)
SCI_GETCARETWIDTH
- The width of the caret can be set with SCI_SETCARETWIDTH
to a value of 0, 1, 2 or
- 3 pixels. The default width is 1 pixel. You can read back the current width with
+ The width of the line caret can be set with SCI_SETCARETWIDTH
to a value of
+ 0, 1, 2 or 3 pixels. The default width is 1 pixel. You can read back the current width with
SCI_GETCARETWIDTH
. A width of 0 makes the caret invisible (added at version
- 1.50).
+ 1.50), similar to setting the caret style to CARETSTYLE_INVISIBLE (though not interchangable).
+ This setting only affects the width of the cursor when the cursor style is set to line caret
+ mode, it does not affect the width for a block caret.
SCI_SETHOTSPOTACTIVEFORE(bool useHotSpotForeColour, int colour)
@@ -2624,7 +2667,7 @@ struct TextToFind {
SCI_GETLINEINDENTPOSITION(int line)
This returns the position at the end of indentation of a line.
- SCI_SETINDENTATIONGUIDES(bool view)
+
SCI_SETINDENTATIONGUIDES(int indentView)
SCI_GETINDENTATIONGUIDES
Indentation guides are dotted vertical lines that appear within indentation white space every
indent size columns. They make it easy to see which constructs line up especially when they
@@ -2632,6 +2675,39 @@ struct TextToFind {
href="#StyleDefinition">STYLE_INDENTGUIDE
(37) is used to specify the
foreground and background colour of the indentation guides.
+ There are 4 indentation guide views.
+ SC_IV_NONE turns the feature off but the other 3 states determine how far the guides appear on
+ empty lines.
+
+
+
+ SC_IV_NONE
+ No indentation guides are shown.
+
+
+
+ SC_IV_REAL
+ Indentation guides are shown inside real indentation white space.
+
+
+
+ SC_IV_LOOKFORWARD
+ Indentation guides are shown beyond the actual indentation up to the level of the
+ next non-empty line.
+ If the previous non-empty line was a fold header then indentation guides are shown for
+ one more level of indent than that line. This setting is good for Python.
+
+
+
+ SC_IV_LOOKBOTH
+ Indentation guides are shown beyond the actual indentation up to the level of the
+ next non-empty line or previous non-empty line whichever is the greater.
+ This setting is good for most languages.
+
+
+
+
+
SCI_SETHIGHLIGHTGUIDE(int column)
SCI_GETHIGHLIGHTGUIDE
When brace highlighting occurs, the indentation guide corresponding to the braces may be
@@ -2694,7 +2770,8 @@ struct TextToFind {
SC_MARK_SMALLRECT
, SC_MARK_SHORTARROW
, SC_MARK_EMPTY
,
SC_MARK_ARROWDOWN
, SC_MARK_MINUS
, SC_MARK_PLUS
,
SC_MARK_ARROWS
, SC_MARK_DOTDOTDOT
, SC_MARK_EMPTY
,
- SC_MARK_BACKGROUND
and SC_MARK_FULLRECT
.
+ SC_MARK_BACKGROUND
, SC_MARK_LEFTRECT
+ and 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.
@@ -2836,7 +2913,9 @@ struct TextToFind {
SCI_MARKERDEFINEPIXMAP(int markerNumber, const char
*xpm)
Markers can be set to pixmaps with this message. The XPM format is used for the pixmap and it
- is limited to pixmaps that use one character per pixel. The data should be null terminated.
+ is limited to pixmaps that use one character per pixel with no named colours.
+ The transparent colour may be named 'None'.
+ The data should be null terminated.
Pixmaps use the SC_MARK_PIXMAP
marker symbol. You can find the full description of
the XPM format here.
@@ -2908,37 +2987,22 @@ struct TextToFind {
Indicators
- 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. Indicators may be displayed as simple underlines, squiggly underlines, a
+
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.
+
+ 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.
- The indicators are set using INDICS_MASK
mask
- and with the values
- INDIC0_MASK
, INDIC1_MASK
and INDIC2_MASK
.
-
- with a 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.
-
- ),
- 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 (The number of bits used for styles can be altered with 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.
-
from 0 to 7 bits. The remaining bits
- can be used for indicators, so there can be from 1 to 8 indicators. However, the
- The SCI_INDIC*
messages allow you to get and set the visual appearance of the
- indicators. They all use an indicatorNumber
argument in the range 0 to 7 to set
- the indicator to style. With the default settings, only indicators 0, 1 and 2 will have any
- visible effect.
+ indicators. They all use an indicatorNumber
argument in the range 0 to INDIC_MAX(31)
+ to set the indicator to style. To prevent interference the set of indicators is divided up into a range for use
+ by lexers (0..7) and a range for use by containers
+ (8=INDIC_CONTAINER
.. 31=INDIC_MAX
).
+
SCI_INDICSETSTYLE(int indicatorNumber, int
indicatorStyle)
SCI_INDICGETSTYLE(int indicatorNumber)
@@ -3046,6 +3110,86 @@ struct TextToFind {
SCI_INDICSETFORE(1, 0xff0000);
(light blue)
SCI_INDICSETFORE(2, 0x0000ff);
(light red)
+ 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
+ is enabled.
+
+ Modern Indicators
+
+ Modern 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.
+
+ SCI_SETINDICATORCURRENT(int indicator)
+ SCI_GETINDICATORCURRENT
+ These two messages set and get the indicator that will be affected by calls to
+ and
+ .
+
+
+
+ SCI_SETINDICATORVALUE(int value)
+ SCI_GETINDICATORVALUE
+ These two messages set and get the value that will be set by calls to
+ .
+
+
+
+ SCI_INDICATORFILLRANGE(int position, int fillLength)
+ SCI_INDICATORCLEARRANGE(int position, int clearLength)
+ These two messages fill or clear a range for the current indicator.
+ SCI_INDICATORFILLRANGE
fills with the
+ the current value.
+
+
+
+ SCI_INDICATORALLONFOR(int position)
+ Retrieve a bitmap value representing which indicators are non-zero at a position.
+
+
+
+ SCI_INDICATORVALUEAT(int indicator, int position)
+ Retrieve the value of a particular indicator at a position.
+
+
+
+ SCI_INDICATORSTART(int indicator, int position)
+ SCI_INDICATOREND(int indicator, int position)
+ Find the start or end of a range with one value from a position within the range.
+ Can be used to iterate through the document to discover all the indicator positions.
+
+
+ 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 INDICS_MASK
mask
+ and with the values
+ INDIC0_MASK
, INDIC1_MASK
and INDIC2_MASK
.
+
+ with a 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.
+
+ ),
+ 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 (The number of bits used for styles can be altered with 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.
+
+
from 0 to 7 bits. The remaining bits
+ can be used for indicators, so there can be from 1 to 8 indicators. However, the
+ Autocompletion
Autocompletion displays a list box showing likely identifiers based upon the user's typing.
@@ -3542,10 +3686,14 @@ struct TextToFind {
SCI_DELETEBACK
SCI_DELETEBACKNOTLINE
+
+
SCI_DELWORDLEFT
SCI_DELWORDRIGHT
+
+ SCI_DELWORDRIGHTEND
@@ -3642,9 +3790,9 @@ struct TextToFind {
SCK_ADD
, SCK_BACK
, SCK_DELETE
, SCK_DIVIDE
,
SCK_DOWN
, SCK_END
, SCK_ESCAPE
, SCK_HOME
,
SCK_INSERT
, SCK_LEFT
, SCK_MENU
, SCK_NEXT
(Page Down),
- SCK_PRIOR
(Page Up), SCK_RETURN
, SCK_RIGHT
,
+ SCK_PRIOR
(Page Up), SCK_RETURN
, SCK_RIGHT
,
SCK_RWIN
,
- SCK_SUBTRACT
, SCK_TAB
, SCK_UP
, and
+ SCK_SUBTRACT
, SCK_TAB
, SCK_UP
, and
SCK_WIN
.
The modifiers are a combination of zero or more of SCMOD_ALT
,
@@ -4134,6 +4282,8 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
+
+
@@ -4315,6 +4465,12 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
+
SCI_SETPOSITIONCACHE(int size)
+ SCI_GETPOSITIONCACHE
+ The position cache stores position information for short runs of text
+ so that their layout can be determined more quickly if the run recurs.
+ The size in entries of this cache can be set with SCI_SETPOSITIONCACHE
.
+
SCI_LINESSPLIT(int pixelWidth)
Split a range of lines indicated by the target into lines that are at most pixelWidth wide.
Splitting occurs on word boundaries wherever possible in a similar manner to line wrapping.
@@ -4631,6 +4787,8 @@ struct SCNotification {
+
+
@@ -4927,6 +5085,27 @@ href="#SCI_POSITIONFROMLINE">SCI_POSITIONFROMLINE(lineNumber);
position, length
+
+ SC_MOD_CHANGEINDICATOR
+
+ 0x4000
+
+ An indicator has been added or removed from a range of text.
+
+ position, length
+
+
+
+ SC_MOD_CHANGELINESTATE
+
+ 0x8000
+
+ A line state has changed because SCI_SETLINESTATE
+ was called.
+
+ line
+
+
SC_MULTILINEUNDOREDO
@@ -5202,6 +5381,15 @@ for line = lineStart to lineEnd do SCI_ENSUREVISIBLE(line) next
double click and the modifiers
field set to the key modifiers
held down in a similar manner to SCN_KEY.
+
+ SCN_INDICATORCLICK
+ SCN_INDICATORRELEASE
+ These notifications are generated when the user clicks or releases the mouse on
+ text that has an indicator.
+ The position
field is set the text position of the click or
+ double click and the modifiers
field set to the key modifiers
+ held down in a similar manner to .
+
SCN_CALLTIPCLICK
This notification is generated when the user clicks on a calltip.
This notification can be used to display the next function prototype when a
@@ -5404,3 +5592,4 @@ EM_SETTARGETDEVICE