From d79bc89300f634c9d9487e031b21590ccb52459c Mon Sep 17 00:00:00 2001
From: nyamatongwe
- There is an overview of the internal design of Scintilla.
-
- Some notes on using Scintilla.
-
- How to use the Scintilla Edit Control on Windows.
-
- A simple sample using Scintilla from C++ on Windows.
-
- A simple sample using Scintilla from Visual Basic.
-
+
+
+
+
+ There is an overview of the internal design of Scintilla.
The coding style used in Scintilla and SciTE
- are worth following if you want to contribute code to Scintilla but are not
+ is worth following if you want to contribute code to Scintilla but is not
compulsory.
@@ -54,1279 +49,2946 @@
it. SciTE exercises most of Scintilla's facilities.
- The Windows version of Scintilla is a Windows Control. As such, its primary programming
+ The Windows version of Scintilla is a Windows Control. As such, its primary programming
interface is through Windows messages. Early versions of Scintilla emulated much of the
API defined by the standard Windows Edit and Richedit controls but those APIs are now
deprecated in favour of Scintilla's own, more consistent API.
In addition to messages performing the actions of a normal Edit control, Scintilla
allows control of syntax styling, markers, auto-completion and call tips.
- The messages are (with wParam and lParam use)
+ The GTK+ version also uses messages in a similar way to the Windows version. This is different
+ to normal GTK+ practice but made it easier to implement rapidly.
+
+ In the descriptions that follow, the messages are described as function calls with zero,
+ one or two arguments. These two arguments are the standard wParam and lParam familiar
+ to Windows programmers. Although the commands only use the arguments described, because
+ all messages have two arguments whether Scintilla uses them or not, it is strongly
+ recommended that any unused arguments are set to 0. This allows future enhancement of
+ messages without the risk of breaking existing code. Common argument types are:
+
+ Messages with names of the form SCI_SETxxxxx often have a companion
+ SCI_GETxxxxx. To save tedious repetition, if the SCI_GETxxxxx message
+ returns the value set by the SCI_SETxxxxx message, the SET routine
+ is described and the GET routine is left to your imagination.
+
+ 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
+ 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
+ Positions within the Scintilla document refer to a character or the gap before that
+ character. The first character in a document is 0, the second 1 and so on. If a document
+ contains nLen characters the last character is numbered nLen-1. The caret exists between character
+ positions and can be located from before the first character (0) to after the last
+ character (nLen).
+
+ There are places where the caret can not go where two character bytes
+ make up one character. This occurs when a DBCS character from a language like Japanese
+ is included in the document or when line ends are marked with the CP/M
+ standard of a carriage return followed by a line feed. The
+ All lines of text in Scintilla are the same height, and this height is calculated from the
+ largest font in any current style. This restriction is for performance as if lines differed
+ in height then calculations involving positioning of text would require that text to be
+ styled first.
+
+ SCI_GETTEXT(int length, char *text)
+ See also:
+ SCI_SETTEXT(<unused>, const char *text)
+ SCI_SETSAVEPOINT
+ See also:
+ SCI_GETLINE(int line, char *text)
+ See also:
+ SCI_REPLACESEL(<unused>, const char *text)
+ SCI_SETREADONLY(bool readOnly)
+ SCI_GETTEXTRANGE(<unused>, TEXTRANGE *tr)
+ See also:
- 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
- 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. Indicators may be displayed as simple underlines,
- squiggly underlines, a line of small 'T' shapes, a line of diagonal hatching or as strike-out.
- Additional indicators such as blurred could be defined in the future.
- The number of bits used for styles can be altered
- with SCI_SETSTYLEBITS up to a maximum of 7 bits.
- The remaining bits can be used for indicators.
+ SCI_GETSTYLEDTEXT(<unused>, TEXTRANGE *tr)
+ See also:
- Positions within the Scintilla document refer to a character or the gap before that
- character. The caret exists between character positions and can be located from before the
- first character to after the last character. There are places where the caret can not go
- where two character bytes make up one character. This occurs when a DBCS character from a
- language like Japanese is included in the document or when line ends are marked with the CP/M
- standard of a carriage return followed by a line feed. The INVALID_POSITION constant (-1)
- represents an invalid position within the document.
+ SCI_ADDTEXT(int length, char *s)
- All lines of text in Scintilla are the same height, and this height is calculated from the
- largest font in any current style. This restriction is for performance as if lines differed
- in height then calculations involving positioning of text would require that text to be
- styled first.
+ SCI_ADDSTYLEDTEXT(int length, cell *s)
+ SCI_APPENDTEXT(int length, char *s)
- When wanting to completely restyle the document, for example after choosing a lexer,
- the SCI_CLEARDOCUMENTSTYLE can be used to clear all styling information and
- reset the folding state.
+ SCI_INSERTTEXT(int pos, const char *text)
- SCI_APPENDTEXT appends a string to the end of the document
- without changing the selection range.
+ SCI_CLEARALL
- Using SCI_REPLACESEL, modifications cause scrolling and other visible changes
- which may take some time and cause unwanted display updates. If performing many
- changes, such as a replace all command, the target can be used instead.
- First set the range to be replaced. Then call SCI_REPLACETARGET or
- SCI_REPLACETARGETRE which returns the length taken by the replacement string.
- The difference between SCI_REPLACETARGET and SCI_REPLACETARGETRE
- is that SCI_REPLACETARGETRE looks for \d patterns in the replacement text
- where d is a digit from 1 to 9 and substitutes in the values of tagged matches from the
- most recent regular expression search.
-
- Searching can be performed within the target range with SCI_SEARCHINTARGET
- which uses a counted string to allow searching for null characters.
- Returns length of range or -1 for failure in which case target is not moved.
- The flags used by SCI_SEARCHINTARGET such as SCFIND_MATCHCASE,
- SCFIND_WHOLEWORD, SCFIND_WORDSTART, and SCFIND_REGEXP can
- be set with SCI_SETSEARCHFLAGS. The SCI_SEARCHINTARGET call
- may be simpler for some clients to use than SCI_FINDTEXT as that requires
- using a pointer to a structure.
+ SCI_CLEARDOCUMENTSTYLE
+ SCI_GETCHARAT(int pos)
+ SCI_GETSTYLEAT(int pos)
+ SCI_SETSTYLEBITS(int bits)
+
+ If
+ In a regular expression, special characters interpreted are:
+
+ SCI_FINDTEXT(int searchFlags, TextToFind *ttf)
+ The
+ The return value is -1 if the search fails or the position of the start of
+ the found text it is succeeds. The
+ See also:
+ SCI_SEARCHANCHOR
+
+
+ The return value is -1 if nothing is found, otherwise the return value is the
+ start position of the matching text. The selection is updated to show the
+ matched text, but is not scrolled into view.
+
+ See also:
+ Using
+ Searching can be performed within the target range with
+ SCI_SETTARGETSTART(int pos)
+ SCI_REPLACETARGET(int length, const char *text)
+ SCI_REPLACETARGETRE(int length, const char *text)
+ SCI_SETSEARCHFLAGS(int searchFlags)
+ SCI_SEARCHINTARGET(int length, const char *text)
+ See also:
- SCI_GETOVERTYPE returns TRUE if overtyping is active otherwise
- FALSE will be returned. Use SCI_GETOVERTYPE to set the overtype node.
+
- If an error occurs, Scintilla may set an internal error number
- which can be retrieved with SCI_GETSTATUS.
- Not currently used but will be in the future.
- To clear the error status call SCI_SETSTATUS(0).
+ 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.
+
- Scintilla has multiple level undo and redo. It will continue to collect undoable actions
- until memory runs out. Sequences of typing or deleting are compressed into single actions to
- make it easier to undo and redo at a sensible level of detail. Sequences of actions can be
- combined into actions that are undone as a unit. These sequences occur between
- SCI_BEGINUNDOACTION and SCI_ENDUNDOACTION messages. These sequences can be nested and only
- the top level sequences are undone as units.
+ SCI_SETSTATUS(int status)
+ Scintilla has multiple level undo and redo. It will continue to collect undoable actions
+ until memory runs out. Scintilla saves actions that change the document. Scintilla does not
+ save caret and selection movements, view scrolling and the like. Sequences of typing or
+ deleting are compressed into single actions to make it easier to undo and redo at a
+ sensible level of detail. Sequences of actions can be combined into actions that are
+ undone as a unit. These sequences occur between
+ SCI_UNDO
+
+ SCI_REDO
+
+ SCI_EMPTYUNDOBUFFER
+ See also:
- Scintilla Documentation
-
-
+ Scintilla Documentation
+
+
+ Some notes on using Scintilla.
+ How to use the Scintilla Edit Control on Windows.
+ A simple sample using Scintilla from C++ on Windows.
+ A simple sample using Scintilla from Visual Basic.
A detailed description of how to write a lexer, including a discussion of folding.
+
+
+
+
+
+ bool
+
+ Arguments expect the values 0 for false and 1 for true.
+
+
+
+ int
+
+ Arguments are 32-bit signed integers.
+
+
+
+ const char*
+
+ Arguments point at text that is being passed to Scintilla but not modified.
+ The text may be zero terminated or another argument may specify the character
+ count, the description will make this clear.
+
+
+
+ char*
+
+ Arguments point at text buffers that Scintilla will fill with text. In some
+ cases another argument will tell Scintilla the buffer size. In others you
+ must make sure that the buffer is big enough to hold the requested text.
+
+
+
+ colour
+
+ Colours are set using the RGB format (Red, Green, Blue). The intensity of each
+ colour is set in the range 0 to 255. If you have three such intensities, they
+ are combined as: red | (green << 8) | (blue << 16). If you set all intensities
+ to 255, the colour is white. If you set all intensities to 0, the colour is
+ black. When you set a colour, you are making a request. What you will get
+ depends on the capabilities of the system and the current screen mode.
+
+
+
+
+<unused>
+
+ This is an unused argument. Please set it to 0.
+
+
+ Message categories
+
+
+
+
+
+
+Text retrieval and modification
+ Search and replace using the target
+ Overtype
+
+
+Cut, copy and paste
+ Error handling
+ Undo and Redo
+
+
+Selection and information
+ Scrolling and automatic scrolling
+ Searching
+
+
+White space
+ Cursor
+ Mouse capture
+
+
+Line endings
+ Styling
+ Style definition
+
+
+Caret and selection styles
+ Margins
+ Other settings
+
+
+Brace highlighting
+ Tabs and Indentation Guides
+ Markers
+
+
+Indicators
+ Autocompletion
+ User lists
+
+
+Calltips
+ Keyboard commands
+ Key bindings
+
+
+Popup edit menu
+ Macro recording
+ Direct access
+
+
+Multiple views
+ Folding
+ Zooming
+
+
+Long lines
+ Lexer
+ Notifications
+
+
+
+Deprecated messages
+ Edit messages never supported by Scintilla
+ Building Scintilla
+
+ Text retrieval and modification
+
+
+SCI_GETTEXT(int length, char *text)
+SCI_SETTEXT(<unused>, const char *text)
+SCI_SETSAVEPOINT
+SCI_GETLINE(int line, char *text)
+SCI_REPLACESEL(<unused>, const char *text)
+SCI_SETREADONLY(bool readOnly)
+SCI_GETREADONLY
+SCI_GETTEXTRANGE(<unused>, TEXTRANGE *tr)
+SCI_ADDTEXT(int length, char *s)
+SCI_ADDSTYLEDTEXT(int length, cell *s)
+SCI_APPENDTEXT(int length, char *s)
+SCI_INSERTTEXT(int pos, char *text)
+SCI_CLEARALL
+SCI_CLEARDOCUMENTSTYLE
+SCI_GETCHARAT(int position)
+SCI_GETSTYLEAT(int position)
+SCI_GETSTYLEDTEXT(<unused>, TEXTRANGE *tr)
+SCI_SETSTYLEBITS(int bits)
+SCI_GETSTYLEBITS
+
+ SCI_SETSTYLEBITS
+ up to a maximum of 7 bits. The remaining bits can be used for indicators.
+ INVALID_POSITION constant (-1)
+ represents an invalid position within the document.
+
+ This returns length-1 characters of text from the start of the document plus one
+ terminating 0 character. To collect all the text in a document, use SCI_GETLENGTH to get the number
+ of characters in the document (nLen), allocate a character buffer of length nLen+1 bytes, then call
+ SCI_GETTEXT(nLen+1, char *text). If you then save the text you should use
+ SCI_SETSAVEPOINT to mark the text as unmodified.
+ SCI_GETSELTEXT,
+ SCI_GETCURLINE,
+ SCI_GETLINE,
+ SCI_GETSTYLEDTEXT,
+ SCI_GETTEXTRANGE
+
+ This replaces all the text in the document with the zero terminated text string you pass in.
+
+ This message tells Scintilla that the current state of the document is unmodified.
+ This is usually done when the file is saved or loaded, hence the name "save point".
+ As Scintilla performs undo and redo operations, it notifies the container that it
+ has entered or left the save point with SCN_SAVEPOINTREACHED and
+ SCN_SAVEPOINTLEFT notification messages,
+ allowing the container to know if the file should be considered dirty or not.
+ SCI_EMPTYUNDOBUFFER,
+ SCI_GETMODIFY
+
+ This fills the buffer defined by text with the contents of the nominated line (lines start
+ at 0). The buffer is not terminated by a 0 character. It is up to you to make sure that
+ the buffer is long enough for the text, use
+ SCI_LINELENGTH(int line).
+ The returned value is the number of characters copied to the buffer. The returned text
+ includes any end of line characters. If you ask for a line number outside the range of lines
+ in the document, 0 characters are copied.
+ SCI_GETCURLINE,
+ SCI_GETSELTEXT,
+ SCI_GETTEXTRANGE,
+ SCI_GETSTYLEDTEXT,
+ SCI_GETTEXT
+
+ The currently selected text between the anchor and the current position is replaced by the
+ 0 terminated text string. If the anchor and current position are the same, the text is inserted
+ at the caret position. The caret is positioned after the inserted text and the caret is scrolled
+ into view.
+
+ SCI_GETREADONLY
+ Set and get the read only flag for the document.
+
+ This collects the text between the positions cpMin and cpMax
+ and copies it to lpstrText (see struct TextRange in Scintilla.h).
+ If cpMax is -1, text is returned to the end of the
+ document. The text is 0 terminated, so you must supply a buffer that is at least 1 character
+ longer than the number of characters you wish to read. The return value is the length of the
+ returned text not including the terminating 0.
+ SCI_GETSELTEXT,
+ SCI_GETLINE,
+ SCI_GETCURLINE,
+ SCI_GETSTYLEDTEXT,
+ SCI_GETTEXT
- Text retrieval and modification.
-
-
-SCI_GETTEXT(int length, char *text)
-SCI_SETTEXT(<unused>, char *text)
-SCI_GETLINE(int line, char *text)
-SCI_REPLACESEL(<unused>, char *text)
-SCI_SETREADONLY(bool readOnly)
-SCI_GETREADONLY
-SCI_GETTEXTRANGE(<unused>, TEXTRANGE *tr)
-SCI_ADDTEXT(int length, char *s)
-SCI_ADDSTYLEDTEXT(int length, cell *s)
-SCI_APPENDTEXT(int length, char *s)
-SCI_INSERTTEXT(int pos, char *text)
-SCI_CLEARALL
-SCI_CLEARDOCUMENTSTYLE
-SCI_GETCHARAT(int position)
-SCI_GETSTYLEAT(int position)
-SCI_GETSTYLEDTEXT(<unused>, TEXTRANGE *tr)
-SCI_SETSTYLEBITS(int bits)
-SCI_GETSTYLEBITS
-
+ This collects styled text into a buffer using two bytes for each cell, with
+ the character at the lower address of each pair and the style byte at the upper
+ address. Characters between the positions cpSCI_GETTEXTMin and
+ cpMSCI_GETTEXTax are copied to lpsSCI_GETTEXTtrText
+ (see struct TextRange in Scintilla.h). Two 0 bytes are added to the end of the text,
+ so the buffer that lpstrText points at must be at least
+ 2*(cpMax-cpMin)+2 bytes long.No check is made for sensible values of
+ cpMin or cpMax. Positions outside the document
+ return character codes and style bytes of 0.
+ SCI_GETSELTEXT,
+ SCI_GETLINE,
+ SCI_GETCURLINE,
+ SCI_GETTEXTRANGE,
+ SCI_GETTEXT
+ This inserts the first length characters from the string s
+ including any 0's in the string that you might have expected to stop the insert
+ operation. The current position is set at the end of the inserted text, but
+ it is not scrolled into view.
+ This behaves just like SCI_ADDTEXT, but inserts styled text.
+
+ SCI_APPENDTEXT appends a string to the end of the document
+ without changing the selection range.
+ This inserts the zero terminated text string at position pos or
+ at the current position if pos is -1.
+ The current position is set at the end of the inserted text, but it is not scrolled into view.
+ Unless the document is read only, this deletes all the text.
-SCI_SETTARGETSTART(int pos)
-SCI_GETTARGETSTART
-SCI_SETTARGETEND(int pos)
-SCI_GETTARGETEND
-SCI_REPLACETARGET(int length, char *text)
-SCI_REPLACETARGETRE(int length, char *text)
-SCI_SETSEARCHFLAGS(int flags)
-SCI_GETSEARCHFLAGS
-SCI_SEARCHINTARGET(int length, string text)
-
+ When wanting to completely restyle the document, for example after choosing a lexer,
+ the SCI_CLEARDOCUMENTSTYLE can be used to clear all styling information and
+ reset the folding state.
+
+ This returns the character at pos in the document or 0 if
+ pos is negative or past the end of the document.
+
+ This returns the style at pos in the document, or 0 if
+ pos is negative or past the end of the document.
+
+ 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 7 style bits. The remaining bits can be used as indicators.
+ The standard setting is SCI_SETSTYLEBITS(5).
+
+ Searching
+
+
+SCI_FINDTEXT(int flags, TextToFind *ttf)
+SCI_SEARCHANCHOR
+SCI_SEARCHNEXT(int searchFlags, const char *text)
+SCI_SEARCHPREV(int searchFlags, const char *text)
+
+ searchFlags
+ Several of the search routines use flag options which include a simple regular
+ expression search. Combine the flag options by adding them:
+
+
+
+
+
+
+ SCFIND_MATCHCASEA match only occurs with text that matches the case of the search string.
+
+
+
+ SCFIND_WHOLEWORDA match only occurs if the characters before and after are not word characters.
+
+
+
+ SCFIND_WORDSTARTA match only occurs if the character before is not a word character.
+
+
+
+
+ SCFIND_REGEXPThe search string should be interpreted as a regular expression.
+ SCFIND_REGEXP is not included in the searchFlags,
+ you can search backwards to find the previous occurance of a search string by
+ setting the end of the search range before the start.
+ If SCFIND_REGEXP is included searches are always from a lower
+ position to a higher position, even if the search range is backwards.
+
+
+
+
+
+
+
+ .Matches any character
+
+
+
+ \(This marks the start of a region for tagging a match.
+
+
+
+ \)This marks the end of a tagged region.
+
+
+
+ \nWhere
+ n is 1 through 9 refers to the first through ninth
+ tagged region when replacing. For example if the search string was
+ Fred\([1-9]\)XXX and the replace string was
+ Sam\1YYY applied to Fred2XXX
+ this would generate Sam2YYY.
+
+
+ \<This matches the start of a word using Scintilla's definitions of words.
+
+
+ \>
+ This matches the end of a word using Scintilla's definition of words.
+
+
+
+ \xThis allows you to use a character x that would otherwise have a special meaning.
+ For example, \[ would be interpreted as [ and not as the start of a character set.
+
+
+
+ [...]This indicates a set of characters, for example [abc] means any of the characters
+ a, b or c. You can also use ranges, for example [a-z] for any lower case character.
+
+
+
+ [^...]The complement of the characters in the set. For example, [^A-Za-z] means any character
+ except an alphabetic character.
+
+
+
+ ^This matches the start of a line (unless used inside a set, see above).
+
+
+
+ $This matches the end of a line.
+
+
+
+ *This matches 0 or more times. For example
+ Sa*m
+ matches Sm, Sam, Saam, Saaam and so on.
+
+
+
+ +This matches 1 or more times. For example
+ Sa+m
+ matches Sam, Saam, Saaam and so on.
+ This message searches for text in the document. It does not use or move the
+ current selection. The searchFlags argument
+ controls the search type, which includes regular expression searches.
+ TextToFind structure is defined in Scintilla.h; set
+ chrg.cpMin and chrg.cpMax with the range of
+ positions in the document to search. If SCFIND_REGEXP is
+ included in the flags, the search is always
+ forwards (even if chrg.cpMax is less than chrg.cpMin).
+ If SCFIND_REGEXP is
+ not included, you can search backwards by setting chrg.cpMax less than
+ chrg.cpMin. Set the lpstrText member of
+ TextToFind to point at a zero terminated
+ text string holding the search pattern. If your language makes the use of
+ TextToFind difficult, you should consider using
+ SCI_SEARCHINTARGET instead.
+ chrgText.cpMin and
+ chrgText.cpMax members
+ of TextToFind are filled in with the start and end positions of the found text.
+ SCI_SEARCHINTARGET
+
+ SCI_SEARCHNEXT(int searchFlags, const char *text)
+ SCI_SEARCHPREV(int searchFlags, const char *text)
+ These messages provide relocatable search support. This allows multiple incremental
+ interactive searches to be macro recorded while still setting the selection to found
+ text so the find/select operation is self-contained. These three messages send
+ SCN_MACRORECORD notifications if
+ macro recording is enabled.
+ SCI_SEARCHANCHOR sets the search start point used by SCI_SEARCHNEXT and
+ SCI_SEARCHPREV to the start of the current selection, that is, the
+ end of the selection that is nearer to the start of the document. You should
+ always call this before calling either of SCI_SEARCHNEXT or SCI_SEARCHPREV.
+ SCI_SEARCHNEXT and SCI_SEARCHPREV search for the next
+ and previous occurance of
+ the zero terminated search string pointed at by text. The search is modified by
+ the searchFlags. If you request a regular expression,
+ SCI_SEARCHPREV finds the first occurance of the seach string in the document,
+ not the previous one before the anchor point.
+ SCI_SEARCHINTARGET,
+ SCI_FINDTEXT
+ Search and replace using the target
+
+
+SCI_SETTARGETSTART(int pos)
+SCI_GETTARGETSTART
+SCI_SETTARGETEND(int pos)
+SCI_GETTARGETEND
+SCI_REPLACETARGET(int length, const char *text)
+SCI_REPLACETARGETRE(int length, const char *text)
+SCI_SETSEARCHFLAGS(int searchFlags)
+SCI_GETSEARCHFLAGS
+SCI_SEARCHINTARGET(int length, const char *text)
+
+ SCI_REPLACESEL, modifications
+ cause scrolling and other visible changes which may take some time and cause
+ unwanted display updates. If performing many changes, such as a replace all
+ command, the target can be used instead. First set the range to be replaced.
+ Then call SCI_REPLACETARGET or SCI_REPLACETARGETRE.
+ SCI_SEARCHINTARGET
+ which uses a counted string to allow searching for null characters.
+ Returns length of range or -1 for failure in which case target is not moved.
+ The flags used by SCI_SEARCHINTARGET such as SCFIND_MATCHCASE,
+ SCFIND_WHOLEWORD, SCFIND_WORDSTART, and SCFIND_REGEXP can
+ be set with SCI_SETSEARCHFLAGS. SCI_SEARCHINTARGET may
+ be simpler for some clients to use than SCI_FINDTEXT
+ as that requires using a pointer to a structure.
+
+ SCI_GETTARGETSTART
+ SCI_SETTARGETEND(int pos)
+ SCI_GETTARGETEND
+ These functions set and return the start and end of the target. When searching in
+ non-regular expression mode, you can set start greater than end to find the last
+ matching text in the target rather than the first matching text. The target is also
+ set by a sucessful SCI_SEARCHINTARGET.
+
+ If length is -1, text is a zero terminated string, otherwise length sets the number
+ of character to replace the target with. The return value is the length of the replacement
+ string.
+
+ This replaces the target using regular expressions. The replacement string is formed
+ from the text string with any sequences of \1 through \9
+ replaced by tagged matches from the most recent regular expression search. The
+ return value is the length of the replacement string.
+
+ SCI_GETSEARCHFLAGS
+ These get and set the searchFlags used by
+ SCI_SEARCHINTARGET.
+ There are several option flags including a simple regular expression search.
+
+ This searches for the first occurance of a text string in the target defined by
+ SCI_SETTARGETSTART and SCI_SETTARGETEND. The text string
+ is not zero terminated; the size is set by length. The search is modified
+ by the search flags set by SCI_SETSEARCHFLAGS. If the search succeeds,
+ the target is set to the found text and the return value is the position of the
+ start of the matching text. If the search fails, the result is -1.
+ SCI_FINDTEXT
+
+ Overtype
+
-SCI_SETOVERTYPE
+SCI_SETOVERTYPE(bool overType)
SCI_GETOVERTYPE
SCI_GETOVERTYPE returns TRUE (1) if overtyping is active otherwise
+ FALSE (0) will be returned. Use SCI_GETOVERTYPE to set the overtype node.
- Standard commands
-
+
+
+ Cut, copy and paste
+
SCI_CUT
SCI_COPY
SCI_PASTE
SCI_CLEAR
SCI_CANPASTE
-
-
- Error handling
-
-
-SCI_SETSTATUS
-SCI_GETSTATUS
SCI_CANPASTE returns non-zero if there is anything in the clipboard in
+ a suitable format for pasting. If you need a "can copy" or "can cut", use
+ SCI_GETSELECTIONSTART()-SCI_GETSELECTIONEND()
+ which will be non-zero if you can copy or cut to the clipboard.
- Undo and Redo
-
-
-SCI_UNDO
-SCI_CANUNDO
-SCI_EMPTYUNDOBUFFER
-SCI_REDO
-SCI_CANREDO
-SCI_SETUNDOCOLLECTION(bool collectUndo)
-SCI_GETUNDOCOLLECTION
-SCI_BEGINUNDOACTION
-SCI_ENDUNDOACTION
-
+
+
+ Error handling
+
+ SCI_GETSTATUS
+ If an error occurs, Scintilla may set an internal error number that can be retrieved with
+ SCI_GETSTATUS. Not currently used but will be in the future. To clear the error status
+ call SCI_SETSTATUS(0).
- Selection and information
-
-
-SCI_GETTEXTLENGTH
-SCI_GETFIRSTVISIBLELINE
-SCI_GETLINECOUNT
-SCI_GETMODIFY
-SCI_SETSEL(int start, int end)
-SCI_GETSELTEXT(<unused>, char *text)
-SCI_LINEFROMPOSITION(int position)
-SCI_POSITIONFROMLINE(int line)
-SCI_GETLINEENDPOSITION(int line)
-SCI_LINELENGTH(int line)
-SCI_POSITIONFROMPOINT(int x, int y)
-SCI_POSITIONFROMPOINTCLOSE(int x, int y)
-SCI_POINTXFROMPOSITION(<unused>, int position)
-SCI_POINTYFROMPOSITION(<unused>, int position)
-SCI_HIDESELECTION(bool hide)
-SCI_GETLENGTH
-SCI_SETCURRENTPOS(int position)
-SCI_GETCURRENTPOS
-SCI_SETANCHOR(int position)
-SCI_GETANCHOR
-SCI_SETSELECTIONSTART(int position)
-SCI_GETSELECTIONSTART
-SCI_SETSELECTIONEND(int position)
-SCI_GETSELECTIONEND
-SCI_SELECTALL
-SCI_GOTOLINE(int line)
-SCI_GOTOPOS(int position)
-SCI_GETCURLINE(int textlen, char *text)
-SCI_LINESONSCREEN
-SCI_SELECTIONISRECTANGLE
-SCI_MOVECARETINSIDEVIEW
-SCI_WORDENDPOSITION(int position, bool onlyWordCharacters)
-SCI_WORDSTARTPOSITION(int position, bool onlyWordCharacters)
-SCI_TEXTWIDTH(int stylenumber, char *text)
-SCI_TEXTHEIGHT(int line)
-SCI_CHOOSECARETX
-
+
+
+ Undo and Redo
+
+
+SCI_UNDO
+SCI_CANUNDO
+SCI_EMPTYUNDOBUFFER
+SCI_REDO
+SCI_CANREDO
+SCI_SETUNDOCOLLECTION(bool collectUndo)
+SCI_GETUNDOCOLLECTION
+SCI_BEGINUNDOACTION
+SCI_ENDUNDOACTION
+
+ SCI_BEGINUNDOACTION and
+ SCI_ENDUNDOACTION messages. These sequences can be nested and only
+ the top level sequences are undone as units.
+
+ SCI_CANUNDO
+ SCI_UNDO undoes one action, or if the undo buffer has reached a
+ SCI_ENDUNDOACTION point, all the actions back to the corresponding
+ SCI_BEGINUNDOACTION.
+ SCI_CANUNDO returns 0 if there is nothing to undo, and 1 if there is.
+ You would typically use the result of this message to enable/disable the Edit menu
+ Undo command.
+
+ SCI_CANREDO
+ SCI_REDO undoes the effect of the last SCI_UNDO operation.
+ SCI_CANREDO returns 0 if there is no action to redo and 1 if there are undo actions
+ to redo. You could typically use the result of this message to enable/disable the
+ Edit menu Redo command.
+
+ This command tells Scintilla to forget any saved undo or redo history. It also sets the save
+ point to the start of the undo buffer, so the document will appear to be unmodified. This
+ does not cause the SCN_SAVEPOINTREACHED notification to be sent to the container.
+ SCI_SETSAVEPOINT
+
+ SCI_GETUNDOCOLLECTION
+ You can control whether Scintilla collects undo information with
+ SCI_SETUNDOCOLLECTION. Pass in true (1) to collect
+ information and false (0) to stop collecting. If you stop
+ collection, you should also use SCI_EMPTYUNDOBUFFER to avoid the
+ undo buffer being unsynchronised with the data in the buffer.
+
+ You might wish to turn off saving undo information if you use the Scintilla to store + text generated by a program (a Log view) or in a display window where text is often + deleted and regenerated. +
+
+ SCI_BEGINUNDOACTION
+ SCI_ENDUNDOACTION
+ Send these two messages to Scintilla to mark the beginning and end of a set of operations
+ that you want to undo all as one operation but that you have to generate as several
+ operations. Alternatively, you can use these to mark a set of operations that you do
+ not want to have combined with the preceding or following operations if they are undone.
+
+SCI_GETTEXTLENGTH +SCI_GETLENGTH +SCI_GETLINECOUNT +SCI_GETFIRSTVISIBLELINE +SCI_LINESONSCREEN +SCI_GETMODIFY +SCI_SETSEL(int anchorPos, int currentPos) +SCI_GOTOPOS(int position) +SCI_GOTOLINE(int line) +SCI_SETCURRENTPOS(int position) +SCI_GETCURRENTPOS +SCI_SETANCHOR(int position) +SCI_GETANCHOR +SCI_SETSELECTIONSTART(int position) +SCI_GETSELECTIONSTART +SCI_SETSELECTIONEND(int position) +SCI_GETSELECTIONEND +SCI_SELECTALL +SCI_LINEFROMPOSITION(int position) +SCI_POSITIONFROMLINE(int line) +SCI_GETLINEENDPOSITION(int line) +SCI_LINELENGTH(int line) +SCI_GETCOLUMN(int position) +SCI_POSITIONFROMPOINT(int x, int y) +SCI_POSITIONFROMPOINTCLOSE(int x, int y) +SCI_POINTXFROMPOSITION(<unused>, int position) +SCI_POINTYFROMPOSITION(<unused>, int position) +SCI_HIDESELECTION(bool hide) +SCI_GETSELTEXT(<unused>, char *text) +SCI_GETCURLINE(int textlen, char *text) +SCI_SELECTIONISRECTANGLE +SCI_MOVECARETINSIDEVIEW +SCI_WORDENDPOSITION(int position, bool onlyWordCharacters) +SCI_WORDSTARTPOSITION(int position, bool onlyWordCharacters) +SCI_TEXTWIDTH(int stylenumber, char *text) +SCI_TEXTHEIGHT(int line) ++
+ Scintilla maintains a selection which stretches between two points, the anchor and the + current position. If the anchor and the current position are the same, there is no selected + text. Positions in the document range from 0 (before the first character), to the document + size (after the last character). If you use messages, there is nothing to stop you setting + a position that is in the middle of a CRLF pair, or in the middle of a 2 byte character. + However, keyboard commands will not move the caret into such positions. +
+
- Scintilla maintains a selection which stretches between two points, the anchor and the
- current position.
+ SCI_GETTEXTLENGTH
+ SCI_GETLENGTH
+ Both these messages return the length of the document in characters.
- It is not possible to change the modified status as whether the document is modified is
- determined by whether the undo position is at the save point.
+ SCI_GETLINECOUNT
+ This returns the number of lines in the document. An empty document contains 1 line. A document
+ holding only an end of line sequence has 2 lines.
- SCI_GETCURLINE retrieves the text of the line containing the caret and returns the position
- within the line of the caret.
+ SCI_GETFIRSTVISIBLELINE
+ This returns the line number of the first visible line in the Scintilla view. The first line
+ in the document is numbered 0.
- SCI_POSITIONFROMPOINT finds the closest character position to a point and
- SCI_POSITIONFROMPOINTCLOSE is similar but returns -1 if the point is
- outside the window or not close to any characters.
+ SCI_LINESONSCREEN
+ This returns the number of complete lines visible on the screen. With a constant line
+ height, this is the vertical space available divided by the line separation. Unless you
+ arrange to size your window to an integral number of lines, there may be a partial line
+ visible at the bottom of the view.
- SCI_POINTXFROMPOSITION and SCI_POINTYFROMPOSITION
- can be used to find the pixel location of text on the display.
- SCI_TEXTWIDTH can be used to find the pixel width of a string which
- can be used, for example, to decide how wide to make the line number
- margin in order to display a given number of numerals. SCI_TEXTHEIGHT
- returns the height in pixels of a particular line. Currently all lines are the
- same height.
+ SCI_GETMODIFY
+ This returns non-zero if the document is "modified" and 0 if it is "unmodified".
+ The modified status of a document is determined by the undo position relative to the
+ save point. The save point is set by SCI_SETSAVEPOINT,
+ usually when you have saved data to a file.
+
+ If you need to be notified when the document becomes modified, Scintilla notifies
+ the container that it has entered or left the save point with the
+ SCN_SAVEPOINTREACHED and SCN_SAVEPOINTLEFT
+ notification messages.
- SCI_WORDENDPOSITION and SCI_WORDSTARTPOSITION can be used to find
- the start and end of words using the same definition of words as used internally
- within Scintilla.
+ SCI_SETSEL(int anchorPos, int currentPos)
+ If currentPos is negative, it means the end of the document. If
+ anchorPos is negative it means remove any selection (i.e. set
+ the anchor to the same position as currentPos). The caret is
+ scrolled into view after this operation.
- Scintilla remembers the x value of the last position horizontally moved to explicitly
- by the user and this value is then used when moving vertically such as by using
- the up and down keys. This remembered value may be set to the x position of the
- caret with SCI_CHOOSECARETX.
+ SCI_GOTOPOS(int pos)
+ This removes any selection, sets the caret at pos and scrolls the view to make
+ the caret visible, if necessary. It is equivalent to SCI_SETSEL(pos,pos).
+ The anchor position is set the same as the current position.
+ SCI_GOTOLINE(int line)
+ If line is outside the lines in the document (first line is 0), the line set is the
+ first or last. This removes any selection and sets the caret at the
+ start of the line and scrolls the view (if needed) to make it visible. The anchor
+ position is set the same as the current position.
+
+ SCI_SETCURRENTPOS(int pos)
+ This sets the current position and creates a selection between the anchor and the
+ current position. The caret is not scrolled into view.
+
+ See also: SCI_SCROLLCARET
+
+ SCI_GETCURRENTPOS
+ This returns the current position.
+
+ SCI_SETANCHOR(int pos)
+ This sets the anchor position and creates a selection between the anchor position and the
+ current position. The caret is not scrolled into view.
+
+ See also: SCI_SCROLLCARET
+
+ SCI_GETANCHOR
+ This returns the current anchor position.
+
+ SCI_SETSELECTIONSTART(int pos)
+ SCI_SETSELECTIONEND(int pos)
+ These set the selection based on the assumption that the anchor position is less than
+ the current position. They do not make the caret visible.
+
| anchor | current | |
|---|---|---|
SCI_SETSELECTIONSTART |
+ pos |
+ Max(pos, current) |
SCI_SETSELECTIONEND |
+ Min(anchor, pos) |
+ pos |
+ See also: SCI_SCROLLCARET
+
+ SCI_GETSELECTIONSTART
+ SCI_GETSELECTIONEND
+ These return the start and end of the selection without regard to which end
+ is the current position and which is the anchor.SCI_GETSELECTIONSTART returns
+ the smaller of the current position or the anchor position. SCI_GETSELECTIONEND
+ returns the larger of the two values.
+
+ SCI_SELECTALL
+ This selects all the text in the document. The current postion is not scrolled into view.
+
+ SCI_LINEFROMPOSITION(int pos)
+ This message returns the line that contains the position pos in the document.
+ The return value is 0 if pos <= 0. The return value is the last line if
+ pos is beyond the end of the document.
+
+ SCI_POSITIONFROMLINE(int line)
+ This returns the document position that corresponds with the start of the line. If
+ line is negative, the position of the line holding the start of the selection is
+ returned. If line is greater than the lines in the document, the return value is -1.
+ If line is equal to the number of lines in the document (i.e. 1 line past the last line),
+ the return value is the end of the document.
+
+ SCI_GETLINEENDPOSITION(int line)
+ This returns the position at the end of the line, before any line end characters. If
+ line is negative, the result is 0. If line is the last line in
+ the document, (which does
+ not have any end of line characters), the result is the size of the document.
+ If line is negative, the result is -1.
+ If line is >= SCI_GETLINECOUNT(), the result is currently
+ SCI_GETLENGTH()-1... (undefined?).
+
+ SCI_LINELENGTH(int line)
+ This returns the length of the line, including any line end characters. If line
+ is negative or beyond the last line in the document, the result is 0. If you want the
+ length of the line not including any end of line characters use
+ SCI_GETLINENDPOSITION(line) -
+ SCI_GETLINEPOSITION(line).
+
text buffer.
+ The buffer must be at least SCI_GETSELECTIONEND()-SCI_SETSELECTIONSTART()+1 bytes
+ long.
+
+ See also: SCI_GETCURLINE,
+ SCI_GETLINE,
+ SCI_GETTEXT,
+ SCI_GETSTYLEDTEXT,
+ SCI_GETTEXTRANGE
+
+ SCI_GETCURLINE(int textlen, char *text)
+ This retrieves the text of the line containing the caret and returns the position
+ within the line of the caret. Pass in char* text pointing at a buffer large enough
+ to hold the text you wish to retrieve and a terminating 0 character. Set textLen to
+ the length of the buffer.
+
+ See also: SCI_GETSELTEXT,
+ SCI_GETLINE,
+ SCI_GETTEXT,
+ SCI_GETSTYLEDTEXT,
+ SCI_GETTEXTRANGE
+
+ SCI_SELECTIONISRECTANGLE
+ This returns 1 if the current selection is in rectangle mode, 0 if not.
+
+ SCI_MOVECARETINSIDEVIEW
+ If the caret is off the top or bottom of the view, it is moved to the nearest line
+ that is visible to its current position. Any selection is lost.
+
+ SCI_WORDENDPOSITION(int position, bool onlyWordCharacters)
+ SCI_WORDSTARTPOSITION(int position, bool onlyWordCharacters)
+ These messages return the start and end of words using the same definition of
+ words as used internally within Scintilla. You can set your own list of characters that count
+ as words with SCI_SETWORDCHARS. The position sets the start
+ or the search, which is forwards when searching for the end and backwards when searching for
+ the start.
+
+ Set onlyWordCharacters to true (1) to stop searching at the
+ first non-word character in the
+ search direction. If onlyWordCharacters is false (0), the first
+ character in the search direction
+ sets the type of the search as word or non-word and the search stops at the first non-matching
+ character. Searches are also terminated by the start or end of the document.
+
+ If "w" represents word characters and "." represents non-word characters and
+ "|" represents the position and true or false is the state
+ of onlyWordCharacters:
+
| Initial state | end, true | end, false | start, true | start, false |
|---|---|---|---|---|
| ..ww..|..ww.. | ..ww..|..ww.. | ..ww....|ww.. | ..ww..|..ww.. | ..ww|....ww.. |
| ....ww|ww.... | ....wwww|.... | ....wwww|.... | ....|wwww.... | ....|wwww.... |
| ..ww|....ww.. | ..ww|....ww.. | ..ww....|ww.. | ..|ww....ww.. | ..|ww....ww.. |
| ..ww....|ww.. | ..ww....ww|.. | ..ww....ww|.. | ..ww....|ww.. | ..ww|....ww.. |
+ SCI_TEXTWIDTH(int stylenumber, char *text)
+ This returns the pixel width of a string drawn in the given stylenumber
+ which can be used, for example,
+ to decide how wide to make the line number margin in order to display a given
+ number of numerals.
+
+ SCI_TEXTHEIGHT(int line)
+ This returns the height in pixels of a particular line. Currently all
+ lines are the same height.
+
+ SCI_GETCOLUMN(int pos)
+ This message returns the column number of a position pos within the
+ document taking the width of tabs into account. This returns the
+ column number of the last tab on the line before pos, plus
+ the number of
+ characters between the last tab and pos.If there are no tabs
+ characters on the line, the return value is the number of
+ characters up to the position on the line. In both cases, double byte
+ characters count as a single character. This is
+ probably only useful with monospaced fonts.
+
+ SCI_POSITIONFROMPOINT(int x, int y)
+ SCI_POSITIONFROMPOINTCLOSE(int x, int y)
+ SCI_POSITIONFROMPOINT finds the closest character position to a point and
+ SCI_POSITIONFROMPOINTCLOSE is similar but returns -1 if the point is
+ outside the window or not close to any characters.
+
+ SCI_POINTXFROMPOSITION(<unused>, int pos)
+ SCI_POINTYFROMPOSITION(<unused>, int pos)
+ These messages return the x and y display pixel location of text at position pos in the document.
+
+ SCI_HIDESELECTION(bool hide)
+ The normal state is to make the selection visible by drawing it as set by
+ SCI_SETSELFORE and
+ SCI_SETSELBACK. However, if you hide the selection, it is
+ drawn as normal text.
+
-SCI_LINESCROLL(int column, int line) -SCI_SCROLLCARET -SCI_SETXCARETPOLICY(int caretPolicy, int caretSlop) -SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop) -SCI_SETVISIBLEPOLICY(int caretPolicy, int caretSlop) -SCI_SETHSCROLLBAR(bool visible) -SCI_GETHSCROLLBAR -SCI_SETVSCROLLBAR(bool visible) -SCI_GETVSCROLLBAR -SCI_GETXOFFSET -SCI_SETXOFFSET(int xoffset) -SCI_SETSCROLLWIDTH(int pixelWidth) -SCI_GETSCROLLWIDTH -SCI_SETENDATLASTLINE(bool endAtLastLine) -SCI_GETENDATLASTLINE --
- SCI_SETXCARETPOLICY and SCI_SETYCARETPOLICY set the caret policy.
- The value of caretPolicy is a combination of CARET_SLOP, CARET_STRICT,
- CARET_JUMPS and CARET_EVEN.
- - If CARET_SLOP is set, we can define a slop value: caretSlop.
- This value defines an unwanted zone (UZ) where the caret is... unwanted.
+SCI_LINESCROLL(int column, int line)
+SCI_SCROLLCARET
+SCI_SETXCARETPOLICY(int caretPolicy, int caretSlop)
+SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop)
+SCI_SETVISIBLEPOLICY(int caretPolicy, int caretSlop)
+SCI_SETHSCROLLBAR(bool visible)
+SCI_GETHSCROLLBAR
+SCI_GETXOFFSET
+SCI_SETXOFFSET(int xoffset)
+SCI_SETSCROLLWIDTH(int pixelWidth)
+SCI_GETSCROLLWIDTH
+SCI_SETENDATLASTLINE(bool endAtLastLine)
+SCI_GETENDATLASTLINE
+
+
+ SCI_LINESCROLL(int column, int line)
+ This will attempt to scroll the display by the number of columns and lines that
+ you specify. Positive line values increase the line number at the top of the
+ screen (i.e. they move the text upwards as far as the user is concerned), Negative
+ line values do the reverse.
+
+ The column measure is the width of a space in the default style. Positive values + increase the column at the left edge of the view (i.e. they move the text leftwards + as far as the user is concerned). Negative values do the reverse. +
+ See also:SCI_SETXOFFSET
+
+ SCI_SCROLLCARET
+ If the current position (this is the caret if there is no selection) is not visible
+ the view is scrolled to make it visable according to the current caret policy.
+
+ SCI_SETXCARETPOLICY(int caretPolicy, int caretSlop)
+ SCI_SETYCARETPOLICY(int caretPolicy, int caretSlop)
+ These set the caret policy. The value of caretPolicy is a combination of
+ CARET_SLOP, CARET_STRICT, CARET_JUMPS and CARET_EVEN.
+
CARET_SLOP |
+ If set, we can define a slop value: caretSlop.
+ This value defines an unwanted zone (UZ) where the caret is... unwanted.
This zone is defined as a number of pixels near the vertical margins,
- and as a number of lines near the horizontal margins.+ and as a number of lines near the horizontal margins. By keeping the caret away from the edges, it is seen within its context, so it is likely that the identifier that the caret is on can be completely seen, and that the current line is seen with some of the lines following it which are - often dependent on that line. - - If CARET_STRICT is set, the policy is enforced... strictly. - The caret is centred on the display if slop is not set, - and cannot go in the UZ if slop is set. - - If CARET_JUMPS is set, the display is moved more energetically - so the caret can move in the same direction longer before the policy is applied again. - '3UZ' notation is used to indicate three time the size of the UZ as a distance to the margin. - - If CARET_EVEN is not set, instead of having symmetrical UZs, - the left and bottom UZs are extended up to right and top UZs respectively. + often dependent on that line. + |
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CARET_STRICT |
+ If set, the policy set by CARET_SLOP is enforced... strictly.
+ The caret is centred on the display if caretSlop is not set,
+ and cannot go in the UZ if caretSlop is set.
+ |
+ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CARET_JUMPS |
+ If set, the display is moved more energetically + so the caret can move in the same direction longer before the policy is applied again. + '3UZ' notation is used to indicate three time the size of the UZ as a distance to the margin. + | +||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CARET_EVEN |
+ If not set, instead of having symmetrical UZs,
+ the left and bottom UZs are extended up to right and top UZs respectively.
This way, we favour the displaying of useful information: the begining of lines,
- where most code reside, and the lines after the caret, eg. the body of a function. -
- The xoffset is the horizontal scroll position in pixels.
+ SCI_SETVISIBLEPOLICY(int caretPolicy, int caretSlop)
- SCI_SETSCROLLWIDTH sets the document width assumed for scrolling.
+ SCI_SETHSCROLLBAR(bool visible) - SCI_SETENDATLASTLINE sets the scroll range so that maximum - scroll position has the last line at the bottom of the view (default). - Setting this to false allows scrolling one page below the last line. - -- Searching ---SCI_FINDTEXT(int flags, TextToFind *ttf) --
- Scintilla can find where a string is present in the document.
- There are several option flags including a simple regular expression search.
- SCFIND_MATCHCASE indicates that a match only occurs with a
- string that matches the case of the search string.
- SCFIND_WHOLEWORD indicates that a match only occurs if the characters
- before and after are not word characters. SCFIND_WORDSTART
- indicates that a match only occurs if the character before is not a word character.
+ SCI_SETXOFFSET(int xoffset) SCI_LINESCROLL
- SCFIND_REGEXP indicates that the search string should be interpreted as a regular
- expression. Special characters interpreted are '.' for any character, '\(' and '\)' to tag
- parts of the match, '\1' .. '\9' to refer to tagged parts, '\<' to match the start of a word,
- '\>' to match the end of a word,
- '\' as a quote character, '[' and ']'
- to indicate a set of characters, ^ within a set to complement the set, ^ outside a set
- to match the start of line, $ to match the end of line, * to match 0 or more times,
- + to match 1 or more times
+ SCI_SETSCROLLWIDTH(int pixelWidth)
- See also SCI_SEARCHINTARGET.
+ SCI_SETENDATLASTLINE(bool endAtLastLine) -SCI_SEARCHANCHOR -SCI_SEARCHNEXT(int flags, char *text) -SCI_SEARCHPREV(int flags, char *text) -- - Relocatable search support. This allows - multiple incremental interactive searches to be macro recorded - while still setting the selection to found text so the find/select - operation is self-contained. + + + + White space +++SCI_SETVIEWWS(int wsMode) +SCI_GETVIEWWS +SCI_SETWHITESPACEFORE(bool useWhitespaceForeColour, int colour) +SCI_SETWHITESPACEBACK(bool useWhitespaceBackColour, int colour) ++
+ SCI_SETVIEWWS(int wsMode)
+ The effect of using any other wsMode value is undefined. -- Visible white space ---SCI_GETVIEWWS -SCI_SETVIEWWS(SCWS_INVISIBLE or SCWS_VISIBLEAFTERINDENT or -SCWS_VISIBLEALWAYS) -+
- White space can be made visible which may useful for languages in which whitespace is
- significant, such as Python. Space characters appear as small centred dots and tab characters
- as light arrows pointing to the right. With the SCWS_VISIBLEAFTERINDENT option,
- white space used for indentation is invisible but after the first visible character, it is visible.
+ SCI_SETWHITESPACEFORE<(bool useWhitespaceForeColour,
+ int colour) - Cursor ---SCI_SETCURSOR -SCI_GETCURSOR -- - The cursor is normally chosen in a context sensitive way so will be different over - the margin than when over the text. When performing a slow action, a wait cursor - can be shown by calling SCI_SETCURSOR(SC_CURSORWAIT) and restored - with SCI_SETCURSOR(SC_CURSORNORMAL). + + + Cursor ++
+ SCI_SETCURSOR(int curType)
+ Cursor values 1 through 7 have defined cursors, but only - Mouse Capture ---SCI_SETMOUSEDOWNCAPTURES(bool captures) -SCI_GETMOUSEDOWNCAPTURES -+ + + Mouse capture +
+ SCI_SETMOUSEDOWNCAPTURES(bool captures) + Line endings ++
+ Scintilla can interpret any of the three major line end conventions, Macintosh (\r), Unix
+ (\n) and CP/M / DOS / Windows (\r\n). When the user presses the Enter key, one of these line
+ end strings is inserted into the buffer. The default is \r\n, but this can be changed with
+ the - Line endings --SCI_GETEOLMODE -SCI_SETEOLMODE(SC_EOL_CRLF or SC_EOL_CR or SC_EOL_LF) -SCI_GETVIEWEOL -SCI_SETVIEWEOL(bool visible) -SCI_CONVERTEOLS(SC_EOL_CRLF or SC_EOL_CR or SC_EOL_LF) +SCI_SETEOLMODE(int eolMode) +SCI_GETEOLMODE +SCI_CONVERTEOLS(int eolMode) +SCI_SETVIEWEOL(bool visible) +SCI_GETVIEWEOL
- Scintilla can interpret any of the three major line end conventions, Macintosh (\r), Unix
- (\n) and CP/M / DOS / Windows (\r\n). When the user presses the Enter key, one of these line
- end strings is inserted into the buffer. The default is \r\n, but this can be changed with
- the SCI_SETEOLMODE message taking a an argument of SC_EOL_CRLF, SC_EOL_CR, or SC_EOL_LF. The
- SCI_GETEOLMODE message retrieves the current state.
+ SCI_SETEOLMODE(int eolMode)
- The characters that make up line ends can be made visible with the view EOL option. This
- looks similar to (CR), (LF), or (CR)(LF).
+ SCI_CONVERTEOLS(int eolMode)
- All of the line ends in the document may be changed by calling SCI_CONVERTEOLS with the
- desired line ending.
+ SCI_SETVIEWEOL(bool visible) - Styling ---SCI_GETENDSTYLED -SCI_STARTSTYLING(int position, int mask) -SCI_SETSTYLING(int length, int style) -SCI_SETSTYLINGEX(int length, stylesequence *s) -SCI_SETLINESTATE(int line, int value) -SCI_GETLINESTATE(int line) -SCI_GETMAXLINESTATE -- - Scintilla keeps a record of the last character that is likely to be styled correctly. This + + + Styling ++
+ 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 +SCI_GETENDSTYLED +SCI_STARTSTYLING(int position, int mask) +SCI_SETSTYLING(int length, int style) +SCI_SETSTYLINGEX(int length, const char *styles) +SCI_SETLINESTATE(int line, int value) +SCI_GETLINESTATE(int line) +SCI_GETMAXLINESTATE ++
+ SCI_GETENDSTYLED
- To perform the actual styling, SCI_STARTSTYLING is sent with the position 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. After SCI_STARTSTYLING, multiple
- SCI_SETSTYLING messages are sent for each lexical entity to be styled.
+ SCI_STARTSTYLING(int pos, int mask)
- 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.
+ SCI_SETSTYLING(int length, int style)
- The last line that has any line state can be found with SCI_GETMAXLINESTATE.
+ SCI_SETSTYLINGEX(int length, const char *styles) - Style Definition ---SCI_STYLECLEARALL -SCI_STYLERESETDEFAULT -SCI_STYLESETFORE(int stylenumber, int colour) -SCI_STYLESETBACK(int stylenumber, int colour) -SCI_STYLESETBOLD(int stylenumber, bool bold) -SCI_STYLESETITALIC(int stylenumber, bool italic) -SCI_STYLESETSIZE(int stylenumber, int sizeinpoints) -SCI_STYLESETFONT(int stylenumber, char *fontname) -SCI_STYLESETEOLFILLED(int stylenumber, bool eolfilled) -SCI_STYLESETUNDERLINE(int stylenumber, bool underline) -SCI_STYLESETCHARACTERSET(int stylenumber, int charset) -SCI_STYLESETVISIBLE(int stylenumber, bool visible) -SCI_STYLESETCASE(int stylenumber, SC_CASE_MIXED or SC_CASE_UPPER or SC_CASE_LOWER) -SCI_STYLESETCHANGEABLE(int stylenumber, bool changeable) -
- While the style setting messages mentioned above, change the style
- numbers associated with text, these messages define how those style
- numbers are interpreted visually. The STYLE_DEFAULT style defines
- the attributes that all styles will receive when SCI_STYLECLEARALL
- is called. SCI_STYLERESETDEFAULT resets STYLE_DEFAULT to its state
- when Scintilla was initialised.
+ SCI_SETLINESTATE(int line, int value)
- The EOLFILLED style uses the background colour at the end of the line
- to colour from the last character of the line to the right side of the window.
- This is useful when a document contains embedded sections in another
- language such as HTML pages with embedded JavaScript. By setting both
- the EOLFILLED style and a consistent background colour to all JavaScript
- styles then JavaScript sections will be easily distinguished from HTML.
+ SCI_GETMAXLINESTATE - SCI_STYLESETCHARACTERSET can set a style to use a different - character set than the default. - For example, SCI_STYLESETCHARACTERSET(SCE_C_STRING, - SC_CHARSET_RUSSIAN) would ensure that strings in Russian would - display correctly. - This feature currently only works fully on Windows. - -- The character sets supported on Windows are: -SC_CHARSET_ANSI, SC_CHARSET_ARABIC, SC_CHARSET_BALTIC, -SC_CHARSET_CHINESEBIG5, SC_CHARSET_DEFAULT, -SC_CHARSET_EASTEUROPE, SC_CHARSET_GB2312, SC_CHARSET_GREEK, -SC_CHARSET_HANGUL, SC_CHARSET_HEBREW, SC_CHARSET_JOHAB, -SC_CHARSET_MAC, SC_CHARSET_OEM, SC_CHARSET_SHIFTJIS, -SC_CHARSET_SYMBOL, SC_CHARSET_THAI, SC_CHARSET_TURKISH, and -SC_CHARSET_VIETNAMESE. - -- The character sets supported on GTK+ are SC_CHARSET_ANSI, - SC_CHARSET_EASTEUROPE, SC_CHARSET_GB2312, - SC_CHARSET_HANGUL, and SC_CHARSET_SHIFTJIS. - -- As well as the 32 fundamental lexer styles, there are also some - predefined numbered styles starting at 32, STYLE_DEFAULT, - STYLE_LINENUMBER, STYLE_BRACELIGHT, STYLE_BRACEBAD, - STYLE_CONTROLCHAR, and STYLE_INDENTGUIDE. - These can be defined with the SCI_STYLESET* messages. - To make it easier for client code to discover the range of styles - that are predefined, STYLE_LASTPREDEFINED is set to the style - number of the last predefined style. - -- SCI_STYLESETCASE can force text to be displayed in upper case - (SC_CASE_UPPER) or lower case (SC_CASE_LOWER). - -- SCI_STYLESETCHANGEABLE is an experimental and incompletely - implemented style attribute. - The default setting is changeable but when turned off it makes text - read-only. - Currently only stops caret from being within not-changeable text - and does not yet stop deleting a range that contains not-changeable - text. - -- Caret and Selection styles ---SCI_SETSELFORE(bool useSelectionForeColour, int colour) -SCI_SETSELBACK(bool useSelectionBackColour, int colour) -SCI_SETCARETFORE(int colour) -SCI_GETCARETFORE -SCI_SETCARETLINEVISIBLE(bool show) -SCI_GETCARETLINEVISIBLE -SCI_SETCARETLINEBACK(int colour) -SCI_GETCARETLINEBACK -SCI_SETCARETPERIOD(int milliseconds) -SCI_GETCARETPERIOD -SCI_SETCARETWIDTH(int pixels) -SCI_GETCARETWIDTH -SCI_SETCONTROLCHARSYMBOL(int symbol) -SCI_GETCONTROLCHARSYMBOL -SCI_SETWHITESPACEFORE(bool useWhitespaceForeColour, int colour) -SCI_SETWHITESPACEBACK(bool useWhitespaceBackColour, int colour) -- - The selection is shown by changing the foreground and / or - background colours. - If one of these is not set then that attribute is not changed for - the selection. The default is to show the selection by changing the - background to light grey and leaving the foreground the same as - when it was not selected. - -- The colour of the caret can be set with SCI_SETCARETFORE. - The background colour of the line containing the caret can be - changed to override the styles on that line with - SCI_GETCARETLINEVISIBLE and the colour used set with - SCI_SETCARETLINEBACK. - The caret line background colour is overridden by any background - colour used to display markers. - The rate at which the caret blinks can be set with - SCI_SETCARETPERIOD which determines the time in milliseconds that - the caret is visible or invisible before changing state. - Setting the period to 0 stops the caret blinking. - The width of the caret can be set with SCI_SETCARETWIDTH to a value - of 1, 2 or 3 pixels. - -- By default, the colour of visible whitespace is determined by the lexer in use. The - foreground and / or background colour of all visible whitespace can be set globally, - overriding the lexer's colours with SCI_SETWHITESPACEFORE and - SCI_SETWHITESPACEBACK. - -- SCI_SETCONTROLCHARSYMBOL specifies a character to use to indicate - control characters rather than having them displayed as mnemonics. - -- Margins ---SCI_SETMARGINLEFT(<unused>, int width) -SCI_GETMARGINLEFT -SCI_SETMARGINRIGHT(<unused>, int width) -SCI_GETMARGINRIGHT -- - Gets or sets the width of the blank margin on both sides of the - text. This defaults to one pixel on each side. - --SCI_SETMARGINTYPEN(int margin, SC_MARGIN_SYMBOL | SC_MARGIN_NUMBER) -SCI_GETMARGINTYPEN(int margin) -SCI_SETMARGINWIDTHN(int margin, int pixelwidth) -SCI_GETMARGINWIDTHN(int margin) -SCI_SETMARGINMASKN(int margin, int mask) -SCI_GETMARGINMASKN(int margin) -SCI_SETMARGINSENSITIVEN(int margin, bool sensitive) -SCI_GETMARGINSENSITIVEN(int margin) -- - There may be up to three margins to the left of the text display. - Each margin may contain marker symbols and some may be set to - display line numbers (with SCI_SETMARGINTYPEN). The markers - displayed in each margin are set with SCI_SETMARGINMASKN. Any - markers not associated with a visible margin will be displayed as - changes in background colour in the text. - A width in pixels can be set for each margin. Margins with a zero - width are ignored completely. Each margin may be made sensitive to - mouse clicks. A click in a sensitive margin will result in a - SCN_MARGINCLICK notification being sent to the container. Margins - that are not sensitive act as selection margins which make it - easy to select ranges of lines. - -- Other settings ---SCI_SETUSEPALETTE(bool allowPaletteUse) -SCI_GETUSEPALETTE -- - On 8 bit displays, which can only display a maximum of 256 colours, - the graphics environment mediates between the colour needs of - applications through the use of palettes. On GTK+, Scintilla always - uses a palette. On Windows, there are some problems with visual - flashing when switching between applications with palettes and it - is also necessary for the application containing the Scintilla - control to forward some messages to Scintilla for its palette code - to work. - -- Because of these issues, the application must tell Scintilla to use - a palette. If Scintilla is not using a palette, then it will only - be able to display in those colours already available, which are - often the 20 Windows system colours. - -- To see an example of how to enable palette support in Scintilla, - search the text of SciTE for WM_PALETTECHANGED, WM_QUERYNEWPALETTE - and SCI_SETUSEPALETTE. - --SCI_SETBUFFEREDDRAW(bool isbuffered) -SCI_GETBUFFEREDDRAW -- - Turns on or off buffered drawing. Buffered drawing draws each line - into a bitmap rather than directly to the screen and then copies - the bitmap to the screen. This avoids flickering although it does - take longer. The default is for drawing to be buffered. - --SCI_SETTABWIDTH(int widthinchars) -SCI_GETTABWIDTH -SCI_SETINDENT(int widthinchars) -SCI_GETINDENT -SCI_SETUSETABS(bool usetabs) -SCI_GETUSETABS -SCI_SETTABINDENTS(bool tabIndents) -SCI_GETTABINDENTS -SCI_SETBACKSPACEUNINDENTS(bool bsUnIndents) -SCI_GETBACKSPACEUNINDENTS -- - SCI_SETTABWIDTH sets the size of a tab as a multiple of the size - of a space character in the style of the first style definition. - SCI_SETINDENT sets the size of indentation in terms of characters. - SCI_SETUSETABS determines whether indentation should be created out - of a mixture of tabs and space or be based purely on spaces. - -- Inside indentation whitespace the tab and backspace keys can be - made to indent and unindent rather than insert a tab character or - delete a character with the SCI_SETTABINDENTS and - SCI_GETBACKSPACEUNINDENTS functions. - --SCI_SETLINEINDENTATION(int line, int indentation) -SCI_GETLINEINDENTATION(int line) -SCI_GETLINEINDENTPOSITION(int line) -SCI_GETCOLUMN(int position) -- - The amount of indentation on a line can be discovered and set with - SCI_GETLINEINDENTATION and SCI_SETLINEINDENTATION. The indentation - is measured in character columns which correspond to the width of - space characters. - SCI_GETLINEINDENTPOSITION returns the position at the end of - indentation of a line. - SCI_GETCOLUMN returns the column number of a position within the - document taking the width of tabs into account. - --SCI_SETCODEPAGE(int codepage) -SCI_GETCODEPAGE -- - Scintilla has some very simple Japanese DBCS (and probably Chinese - and Korean) support. Use this message with argument set to the - code page number to set Scintilla to use code page information to - ensure double byte characters are treated as one character rather - than two. This also stops the caret from moving between the two - bytes in a double byte character. Call with argument set to zero - to disable DBCS support. - -- Code page SC_CP_UTF8 (65001) sets Scintilla into - Unicode mode with the document treated as a sequence of characters - expressed in UTF-8. The text is converted to the platform's normal - Unicode encoding before being - drawn by the OS and can thus display Hebrew, Arabic, Cyrillic, and - Han characters. Languages which can use two characters stacked - vertically in one horizontal space such as Thai will mostly work - but there are som eissues where the characters are drawn - separately leading to visual glitches. Bidirectional text is not - supported. - -- For GTK+, the locale should be set to a Unicode locale with a call similar to - setlocale(LC_CTYPE, "en_US.UTF-8"). Fonts with an "iso10646" registry - should be used in a font set. Font sets are a comma separated list of partial - font specifications where each partial font specification can be in the form of - foundry-fontface-charsetregistry-encoding *OR* - fontface-charsetregistry-encoding *OR* - foundry-fontface *OR* - fontface. An example is "misc-fixed-iso10646-1,*". - --SCI_SETWORDCHARS(<unused>, char *chars) -- - Scintilla has several functions that operate on words which are - defined to be contiguous sequences of characters from a particular - set of characters. This message defines which characters are - members of that set. If chars is null then the default set, - alphanumeric and '_', is used. + + + Style definition ++
+ 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 set, numbered 0 to
+ For each style you can set the font name, size and use of bold, italic + and underline, foreground and background colour and the character set. + You can also choose to hide text with a given style, display all + characters as upper or lower case and fill from the last character on + a line to the end of the line (for embedded languages). There is also an + experimental attribute to make text read-only. + + It is entirely up to you how you use styles. If you want to use syntax + colouring you might use style 0 for white space, style 1 for numbers, + style 2 for keywords, style 3 for strings, style 4 for preprocessor, + style 5 for operators, and so on. +-SCI_GRABFOCUS -SCI_SETFOCUS(bool focus) -SCI_GETFOCUS -- - On GTK+, focus handling is more complicated than on Windows, - so Scintilla can be told with this message to grab the focus. +SCI_STYLERESETDEFAULT +SCI_STYLECLEARALL +SCI_STYLESETFONT(int stylenumber, char *fontname) +SCI_STYLESETSIZE(int stylenumber, int sizeinpoints) +SCI_STYLESETBOLD(int stylenumber, bool bold) +SCI_STYLESETITALIC(int stylenumber, bool italic) +SCI_STYLESETUNDERLINE(int stylenumber, bool underline) +SCI_STYLESETFORE(int stylenumber, int colour) +SCI_STYLESETBACK(int stylenumber, int colour) +SCI_STYLESETEOLFILLED(int stylenumber, bool eolfilled) +SCI_STYLESETCHARACTERSET(int stylenumber, int charset) +SCI_STYLESETCASE(int stylenumber, SC_CASE_MIXED or SC_CASE_UPPER or SC_CASE_LOWER) +SCI_STYLESETVISIBLE(int stylenumber, bool visible) +SCI_STYLESETCHANGEABLE(int stylenumber, bool changeable) + +
+ SCI_STYLERESETDEFAULT
+ SCI_STYLECLEARALL
+ SCI_STYLESETFONT(int stylenumber, char *fontname)
+ SCI_STYLESETUNDERLINE(int stylenumber, bool underline)
+ SCI_STYLESETFORE(int stylenumber, int colour)
+ SCI_STYLESETEOLFILLED(int stylenumber, bool eolfilled)
+ SCI_STYLESETCHARACTERSET(int stylenumber, int charset)
+ The character sets supported on Windows are:
+ The character sets supported on GTK+ are:
+ SCI_STYLESETCASE(int stylenumber, int caseMode)
+ SCI_STYLESETVISIBLE(int stylenumber, bool visible)
+ SCI_STYLESETCHANGEABLE(int stylenumber, bool changeable) - The internal focus flag can be set with SCI_SETFOCUS. - This is used by clients which have complex focus requirements such - as having their own window which gets the real focus but with the - need to indicate that Scintilla has the logical focus. - -- Brace highlighting ---SCI_BRACEHIGHLIGHT(int pos1, int pos2) -SCI_BRACEBADLIGHT(int pos1) -SCI_BRACEMATCH(int position, int maxReStyle) -- - Up to two characters can be highlighted in a 'brace highlighting - style' which is defined as style number 34. If there is no matching - brace then the 'brace badlighting style', style number 35, can be - used to show the brace that is unmatched. Using a position of - INVALID_POSITION removes the highlight. + + + Caret and selection styles +++ The selection is shown by changing the foreground and/or background colours. + If one of these is not set then that attribute is not changed for + the selection. The default is to show the selection by changing the + background to light grey and leaving the foreground the same as + when it was not selected. + When there is no selection, the current insertion point is marked by the + text caret. This is a vertical line that is normally blinking on and off + to attract the users attention. + ++SCI_SETSELFORE(bool useSelectionForeColour, int colour) +SCI_SETSELBACK(bool useSelectionBackColour, int colour) +SCI_SETCARETFORE(int colour) +SCI_GETCARETFORE +SCI_SETCARETLINEVISIBLE(bool show) +SCI_GETCARETLINEVISIBLE +SCI_SETCARETLINEBACK(int colour) +SCI_GETCARETLINEBACK +SCI_SETCARETPERIOD(int milliseconds) +SCI_GETCARETPERIOD +SCI_SETCARETWIDTH(int pixels) +SCI_GETCARETWIDTH +SCI_SETCONTROLCHARSYMBOL(int symbol) +SCI_GETCONTROLCHARSYMBOL ++
+ SCI_SETSELFORE(bool useSelectionForeColour,
+ int colour)
+ SCI_SETCARETFORE(int colour)
+ SCI_SETCARETLINEVISIBLE(bool show)
+ SCI_SETCARETPERIOD(int milliseconds)
+ SCI_SETCARETWIDTH(int pixels)
+ SCI_SETCONTROLCHARSYMBOL(int symbol)
+ You can choose to replace these mnemonics by a nominated symbol with an ASCII
+ code in the range 32 to 255. If you set a symbol value less than 32, all control
+ characters are displayed as mnemonics. The symbol you set is rendered in the the
+ font of the style set for the character. You can read back the current symbol with
+ the - The SCI_BRACEMATCH message finds a corresponding matching brace - given the position of one brace. The brace characters handled are - '(', ')', '[', ']', '{', '}', '<', and '>'. - A match only occurs if the style of the matching brace is the same - as the starting brace or the matching brace is beyond the end of - styling. Nested braces are handled correctly. The maxReStyle - parameter must currently be 0. + + + Margins ++
+ There may be up to three margins to the left of the text display,
+ plus a gap either side of the text. Each margin can be set to
+ display either symbols or line numbers with
+ + The margins are numbered 0 to 2. Using a margin number outside the + valid range has no effect. By default, margin 0 is set to display + line numbers, but is given a width of 0, so it is hidden. Margin 1 is + set to display non-folding symbols and is given a width of 16 pixels, + so it is visible. Margin 2 is set to diplay the folding symbols, but is + given a width of 0, so it is hidden. Of course, you can set the margins + to be whatever you wish. + ++SCI_SETMARGINTYPEN(int margin, int type) +SCI_GETMARGINTYPEN(int margin) +SCI_SETMARGINWIDTHN(int margin, int pixelwidth) +SCI_GETMARGINWIDTHN(int margin) +SCI_SETMARGINMASKN(int margin, int mask) +SCI_GETMARGINMASKN(int margin) +SCI_SETMARGINSENSITIVEN(int margin, bool sensitive) +SCI_GETMARGINSENSITIVEN(int margin) +SCI_SETMARGINLEFT(<unused>, int pixels) +SCI_GETMARGINLEFT +SCI_SETMARGINRIGHT(<unused>, int pixels) +SCI_GETMARGINRIGHT ++
+ SCI_SETMARGINTYPEN(int margin, int iType)
+ SCI_SETMARGINWIDTHN(int margin, int pixelwidth)
+ SCI_SETMARGINMASKN(int margin, int mask)
+ You add logical markers to a line with
+ To set a non-folding margin 1 use
+ SCI_SETMARGINSENSITIVEN(int margin, bool sensitive)
+ SCI_SETMARGINLEFT(<unused>, int pixels) - Indentation Guides --SCI_SETINDENTATIONGUIDES(bool view) -SCI_GETINDENTATIONGUIDES -SCI_SETHIGHLIGHTGUIDE(int column) -SCI_GETHIGHLIGHTGUIDE- - Indentation guides are dotted vertical lines that appear within - indentation whitespace every indent size columns. They make it - easy to see which constructs line up especially when they extend - over multiple pages. Style 37 is used to specify the foreground and - background colour of the indentation guides. + + + Other settings +++SCI_SETUSEPALETTE(bool allowPaletteUse) +SCI_GETUSEPALETTE +SCI_SETBUFFEREDDRAW(bool isbuffered) +SCI_GETBUFFEREDDRAW +SCI_SETCODEPAGE(int codepage) +SCI_GETCODEPAGE +SCI_SETWORDCHARS(<unused>, const char *chars) +SCI_GRABFOCUS +SCI_SETFOCUS(bool focus) +SCI_GETFOCUS ++
+ SCI_SETUSEPALETTE(bool allowPaletteUse) + On Windows, there are some problems with visual + flashing when switching between applications with palettes and it + is also necessary for the application containing the Scintilla + control to forward some messages to Scintilla for its palette code + to work. Because of this, by default, the palette is not used and + the application must tell Scintilla to use one. If Scintilla is not + using a palette it will only display in those colours already available, + which are often the 20 Windows system colours. +
+ To see an example of how to enable palette support in Scintilla,
+ search the text of SciTE for
+ To forward a message
+ While we are on the subject of forwarding messages in Windows, the top level
+ window should forward any
+ SCI_SETBUFFEREDDRAW(bool isbuffered)
+ SCI_SETCODEPAGE(int codepage)
+ Code page + For GTK+, the locale should be set to a Unicode locale with a call similar to + setlocale(LC_CTYPE, "en_US.UTF-8"). Fonts with an "iso10646" registry + should be used in a font set. Font sets are a comma separated list of partial + font specifications where each partial font specification can be in the form of + foundry-fontface-charsetregistry-encoding *OR* + fontface-charsetregistry-encoding *OR* + foundry-fontface *OR* + fontface. An example is "misc-fixed-iso10646-1,*". +
+ {Setting code page to a non-zero value that is not
+ SCI_SETWORDCHARS(<unused>, const char *chars)
+ SCI_GRABFOCUS
+ The internal focus flag can be set with - When brace highlighting occurs, the indentation guide corresponding - to the braces may be highlighted with the brace highlighting style, - 34. + + + Brace highlighting +++SCI_BRACEHIGHLIGHT(int pos1, int pos2) +SCI_BRACEBADLIGHT(int pos1) +SCI_BRACEMATCH(int position, int maxReStyle) ++
+ SCI_BRACEHIGHLIGHT(int pos1, int pos2)
+ SCI_BRACEBADLIGHT(int pos1)
+ SCI_BRACEMATCH(int pos, int maxReStyle)
+ A match only occurs if the style of the matching brace is the same
+ as the starting brace or the matching brace is beyond the end of
+ styling. Nested braces are handled correctly. The - Markers ---SCI_MARKERDEFINE(int markernumber, int markersymbols) -SCI_MARKERDEFINEPIXMAP(int markernumber, const char *xpm) -SCI_MARKERSETFORE(int markernumber, int colour) -SCI_MARKERSETBACK(int markernumber, int colour) -SCI_MARKERADD(int line, int markernumber) -SCI_MARKERDELETE(int line, int markernumber) -SCI_MARKERDELETEALL(int markernumber) -SCI_MARKERGET(int line) -SCI_MARKERNEXT(int lineStart, int markermask) -SCI_MARKERPREVIOUS(int lineStart, int markermask) -SCI_MARKERLINEFROMHANDLE(int handle) -SCI_MARKERDELETEHANDLE(int handle) --
- Markers appear in the selection margin to the left of the text.
- They are small geometric symbols often used in debuggers to
- indicate breakpoints and the current line. If the selection margin
- is set to zero width then the background colour of the whole line
- is changed instead. There may be up to 32 marker symbols defined
- and each line has a set of these markers associated with it. The
- markers are drawn in the order of their numbers. Markers try to
- move with their text by tracking where the start of their line
- moves. When a line is deleted, its markers are combined, by an or
- operation, with the markers of the previous line. The
- SCI_MARKERDELETEALL removes markers of the given number from all
- lines, and treats a parameter of -1 as meaning delete all markers
- from all lines.
- SCI_MARKERGET retrieves the set of markers associated with a line.
- SCI_MARKERNEXT and SCI_MARKERPREVIOUS can be used to efficiently
- search for lines that contain markers. They return the next /
- previous line with a set of markers that includes some of the bits
- set in the markermask parameter. - The marker symbols currently available are SC_MARK_CIRCLE, - SC_MARK_ROUNDRECT, SC_MARK_ARROW, SC_MARK_SMALLRECT, - SC_MARK_SHORTARROW, SC_MARK_EMPTY, SC_MARK_ARROWDOWN, - SC_MARK_MINUS, SC_MARK_PLUS, SC_MARK_ARROWS, and - SC_MARK_DOTDOTDOT. - The SC_MARK_BACKGROUND marker changes the background colour - of the line only. - The SC_MARK_EMPTY symbol is invisible, - allowing client code to track the movement of lines. - Characters can be used as markers by adding - the ASCII value of the character to SC_MARK_CHARACTER. - -- There are also marker symbols available for the folding margin in a - flattened tree style: - SC_MARK_BOXMINUS, - SC_MARK_BOXMINUSCONNECTED, - SC_MARK_BOXPLUS, - SC_MARK_BOXPLUSCONNECTED, - SC_MARK_CIRCLEMINUS, - SC_MARK_CIRCLEMINUSCONNECTED, - SC_MARK_CIRCLEPLUS, - SC_MARK_CIRCLEPLUSCONNECTED, - SC_MARK_LCORNER, - SC_MARK_LCORNERCURVE, - SC_MARK_TCORNER, - SC_MARK_TCORNERCURVE, and - SC_MARK_VLINE. - -- The marker numbers SC_MARKNUM_FOLDER and SC_MARKNUM_FOLDEROPEN are - used for showing that a fold is present and open or closed. Any - symbols may be assigned for this purpose although the - (SC_MARK_PLUS, SC_MARK_MINUS) pair or the (SC_MARK_ARROW, - SC_MARK_ARROWDOWN) pair are good choices. - As well as these two, more assignments are needed for the - flattened tree style: - SC_MARKNUM_FOLDEREND, - SC_MARKNUM_FOLDERMIDTAIL, - SC_MARKNUM_FOLDEROPENMID, - SC_MARKNUM_FOLDERSUB, and - SC_MARKNUM_FOLDERTAIL. - The bits used for folding is specified by SC_MASK_FOLDERS which is - commonly used as an argument to SCI_SETMARGINMASKN when defining a - margin to be used for folding. + + + Tabs and Indentation Guides +++ Indentation (the white space at the start of a line) if often used + by programmers to clarify program structure and in some languages, for + example Python, it may be part of the language syntax. Tabs are + normally used in editors to insert a tab character or to pad text + with spaces up to the next tab. + + Scintilla can be set to treat tab and backspace in the white space at + the start of a line in a special way, so that inserting a tab indents + the line to the next indent position rather than just inserting a tab + at the current character position and backspace unindents the line rather + than deleting a character. Scintilla can also display + indentation guides (vertical lines) to help you to generate code. + ++SCI_SETTABWIDTH(int widthinchars) +SCI_GETTABWIDTH +SCI_SETUSETABS(bool usetabs) +SCI_GETUSETABS +SCI_SETINDENT(int widthinchars) +SCI_GETINDENT +SCI_SETTABINDENTS(bool tabIndents) +SCI_GETTABINDENTS +SCI_SETBACKSPACEUNINDENTS(bool bsUnIndents) +SCI_GETBACKSPACEUNINDENTS +SCI_SETLINEINDENTATION(int line, int indentation) +SCI_GETLINEINDENTATION(int line) +SCI_GETLINEINDENTPOSITION(int line) +SCI_SETINDENTATIONGUIDES(bool view) +SCI_GETINDENTATIONGUIDES +SCI_SETHIGHLIGHTGUIDE(int column) +SCI_GETHIGHLIGHTGUIDE ++
+ SCI_SETTABWIDTH(int widthinchars)
+ SCI_SETUSETABS(bool useTabs) + SCI_GETINDENT + SCI_SETINDENT sets the size of indentation in terms of the width of
+ a space in STYLE_DEFAULT. 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
+ undesireable effects.
+
+
+ SCI_SETTABINDENTS(bool tabIndents)
+ Inside indentation whitespace the tab and backspace keys can be
+ made to indent and unindent rather than insert a tab character or
+ delete a character with the
+ SCI_SETLINEINDENTATION(int line, int indentation)
+ SCI_GETLINEINDENTPOSITION(int line)
+ SCI_SETINDENTATIONGUIDES(bool view)
+ SCI_SETHIGHLIGHTGUIDE(int column) + + +Markers ++
+ There are 32 markers, numbered 0 to 31, and you can assign any
+ combination of them to each line in the document. Markers appear
+ in the selection margin to the
+ left of the text. If the selection margin is set to zero width, the
+ background colour of the whole line is changed instead. Marker numbers 25 to 31
+ are used by Scintilla in folding margins, and have symbolic names of the form
+ + Marker numbers 0 to 24 have no pre-defined function; you can use + them to mark syntax errors or the current point of execution, break + points, or whatever you need marking. If you do not neeed folding, + you can use all 32 for any purpose you wish. +
+ Each marker number has a symbol associated with it. You can also set the
+ foreground and background colour for each marker number, so you can use the
+ same symbol more than once with different colouring for different uses.
+ Scintilla has a set of symbols you can assign ( + The markers are drawn in the order of their numbers, so higher numbered + markers appear on top of lower numbered ones. Markers try to + move with their text by tracking where the start of their line + moves. When a line is deleted, its markers are combined, by an or + operation, with the markers of the previous line. + ++SCI_MARKERDEFINE(int markernumber, int markersymbols) +SCI_MARKERDEFINEPIXMAP(int markernumber, const char *xpm) +SCI_MARKERSETFORE(int markernumber, int colour) +SCI_MARKERSETBACK(int markernumber, int colour) +SCI_MARKERADD(int line, int markernumber) +SCI_MARKERDELETE(int line, int markernumber) +SCI_MARKERDELETEALL(int markernumber) +SCI_MARKERGET(int line) +SCI_MARKERNEXT(int lineStart, int markermask) +SCI_MARKERPREVIOUS(int lineStart, int markermask) +SCI_MARKERLINEFROMHANDLE(int handle) +SCI_MARKERDELETEHANDLE(int handle) ++
+ SCI_MARKERDEFINE(int markernumber, int markersymbols)
+ The
+ There are also marker symbols designed for use in the folding
+ margin in a flattened tree style.
+ SC_MARK_CHARACTER (10000). For example, to use 'A' (ASCII code 65) as
+ marker number 1 use:+ SCI_MARKETDEFINE(1, SC_MARK_CHARACETR+65).
+
+ The marker numbers
+ This table shows which
+ SCI_MARKERSETFORE(int markernumber, int colour)
+ SCI_MARKERADD(int line, int markernumber)
+ SCI_MARKERDELETE(int line, int markernumber)
+ SCI_MARKERDELETEALL(int markernumber)
+ SCI_MARKERGET(int line)
+ SCI_MARKERNEXT(int lineStart, int markermask)
+ SCI_MARKERLINEFROMHANDLE(int markerHandle)
+ SCI_MARKERDELETEHANDLE(int markerHandle)
+ SCI_MARKERDEFINEPIXMAP(int markernumber, const char *xpm) - Indicators ---SCI_INDICSETSTYLE(int indicatornumber, int indicatorstyle) -SCI_INDICGETSTYLE(int indicatornumber) -SCI_INDICSETFORE(int indicatornumber, int colour) -SCI_INDICGETFORE(int indicatornumber) -- - These messages allow setting the visual appearance of the three - (0, 1, and 2) available indicators. - -- The indicator styles currently available are INDIC_PLAIN, - INDIC_SQUIGGLE, INDIC_TT, INDIC_DIAGONAL, and INDIC_STRIKE. - -- The indicators are set using SCI_STARTSTYLING with a INDICS_MASK - mask and SCI_SETSTYLING with the values INDIC0_MASK, INDIC1_MASK - and INDIC2_MASK. + + + + Indicators +++ By default, Scintilla organises 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 line of small 'T' shapes, a line of + diagonal hatching or as strike-out. +
+ The indicators are set using
+
+ The number of bits used for styles can be altered with
+
+ The - Autocompletion -+-SCI_AUTOCSHOW(int lenEntered,char *list) -SCI_AUTOCCANCEL -SCI_AUTOCACTIVE -SCI_AUTOCPOSSTART -SCI_AUTOCCOMPLETE -SCI_AUTOCSTOPS(<unused>,char *chars) -SCI_AUTOCSETSEPARATOR(char separator) -SCI_AUTOCGETSEPARATOR -SCI_AUTOCSELECT(<unused>,char *stringtoselect) -SCI_AUTOCSETCANCELATSTART(bool cancel) -SCI_AUTOCGETCANCELATSTART -SCI_AUTOCSETFILLUPS(<unused>,char *chars) -SCI_AUTOCSETCHOOSESINGLE(bool chooseSingle) -SCI_AUTOCGETCHOOSESINGLE -SCI_AUTOCSETIGNORECASE(bool ignoreCase) -SCI_AUTOCGETIGNORECASE -SCI_AUTOCSETAUTOHIDE(bool autoHide) -SCI_AUTOCGETAUTOHIDE -SCI_AUTOCSETDROPRESTOFWORD(bool dropRestOfWord) -SCI_AUTOCGETDROPRESTOFWORD -- - Auto completion displays a list box based upon the users typing - showing likely identifiers. - The user chooses the currently selected item by pressing the tab character - or another character that is a member of the fillup character set defined - with SCI_AUTOCSETFILLUPS. - -- The SCI_AUTOCSHOW message causes this list to be displayed, with - its argument being a list of words separated by separator - characters. The initial separator character is a space but this can - be set or got with SCI_AUTOCSETSEPARATOR and - SCI_AUTOCGETSEPARATOR. - SCI_AUTOCPOSSTART returns the value of the current position when - SCI_AUTOCSHOW started display of the list. - An entry can be selected SCI_AUTOCSELECT. - The list of words should be in sorted order. - -- The current selection can be triggered with the SCI_AUTOCCOMPLETE - message. This has the same effect as the tab key. When in - autocompletion mode, the list should disappear when the user - types a character that can not be part of the autocompletion, - such as '.', '(' or '[' when typing an identifier. A set of - characters which will cancel autocompletion can be specified - with the SCI_AUTOCSTOPS. +SCI_INDICSETSTYLE(int indicatorNumber, int indicatorStyle) +SCI_INDICGETSTYLE(int indicatorNumber) +SCI_INDICSETFORE(int indicatorNumber, int colour) +SCI_INDICGETFORE(int indicatorNumber) + +
+ SCI_INDICSETSTYLE(int indicatorNumber, int indicatorStyle)
+ The default indicator styles are equivalent to:
- If set to ignore case mode with SCI_AUTOCSETIGNORECASE,
- then strings are matched after being converted to upper case.
- One result of this is that the list should be sorted with the punctuation
- characters '[', '\', ']', '^', '_', and '`' sorted after letters.
+ SCI_INDICSETFORE(int indicatorNumber, int colour) - The default behaviour is for the list to be cancelled if the caret - moves before the location it was at when the list was displayed. - By calling SCI_AUTOCSETCANCELATSTART with a false argument, the - list is not cancelled until the caret moves before the first - character of the word being completed. + + + + Autocompletion ++
+ Autocompletion displays a list box showing likely identifiers,
+ based upon the users typing. The user chooses the currently selected item
+ by pressing the tab character or another character that is a member of
+ the fillup character set defined with
+ To make use of autocompletion you must monitor each character added to the
+ document. See +SCI_AUTOCSHOW(int lenEntered, const char *list) +SCI_AUTOCCANCEL +SCI_AUTOCACTIVE +SCI_AUTOCPOSSTART +SCI_AUTOCCOMPLETE +SCI_AUTOCSTOPS(<unused>,const char *chars) +SCI_AUTOCSETSEPARATOR(char separator) +SCI_AUTOCGETSEPARATOR +SCI_AUTOCSELECT(<unused>,const char *select) +SCI_AUTOCSETCANCELATSTART(bool cancel) +SCI_AUTOCGETCANCELATSTART +SCI_AUTOCSETFILLUPS(<unused>,const char *chars) +SCI_AUTOCSETCHOOSESINGLE(bool chooseSingle) +SCI_AUTOCGETCHOOSESINGLE +SCI_AUTOCSETIGNORECASE(bool ignoreCase) +SCI_AUTOCGETIGNORECASE +SCI_AUTOCSETAUTOHIDE(bool autoHide) +SCI_AUTOCGETAUTOHIDE +SCI_AUTOCSETDROPRESTOFWORD(bool dropRestOfWord) +SCI_AUTOCGETDROPRESTOFWORD ++
+ SCI_AUTOCSHOW(int lenEntered, const char *list)
+ The list of words should be in sorted order. If set to ignore case mode
+ with
+ SCI_AUTOCCANCEL
+ SCI_AUTOCACTIVE
+ SCI_AUTOCPOSSTART
+ SCI_AUTOCCOMPLETE
+ SCI_AUTOCSTOPS(<unused>,const char *chars)
+ SCI_AUTOCSETSEPARATOR(char separator)
+ SCI_AUTOCSELECT(<unused>,const char *select)
+ SCI_AUTOCSETCANCELATSTART(bool cancel)
+ SCI_AUTOCSETFILLUPS(<unused>,const char *chars)
+ SCI_AUTOCSETCHOOSESINGLE(bool chooseSingle)
+ SCI_AUTOCSETIGNORECASE(bool ignoreCase)
- The list will also be cancelled if there are no viable matches.
- To avoid this behaviour call SCI_AUTOCSETAUTOHIDE with a false
- argument.
+ SCI_AUTOCSETAUTOHIDE(bool autoHide)
- When an item is selected, any word characters following the caret are first
- erased if SCI_AUTOCSETDROPRESTOFWORD is used to set this mode.
+ SCI_AUTOCSETDROPRESTOFWORD(bool dropRestOfWord) - User lists ---SCI_USERLISTSHOW(int listType,char *list) -- - User lists are similar to auto completion but do not insert text - when an item is selected, instead notifying the container with a - SCN_USERLISTSELECTION. - The listType parameter is returned to the container and can be used - to differentiate between different types of list such as between a - list of buffers and a list of keywords. + + + User lists ++
+ User lists use the internal mechanisms as autocompletion lists, and all the
+ calls listed for autocompletion work on them; you cannot display a user list
+ at the same time as an autocompletion list is active. They differ in the
+ following respects: + BEWARE: if you have set fillup characters or stop characters, these will + still be active with the user list, and may result in items being selected + or the user list cancelled due to the user typing into the editor. + +
+ SCI_USERLISTSHOW(int listType, const char *list) - Calltips ---SCI_CALLTIPSHOW(int posStart, char *definition) -SCI_CALLTIPCANCEL -SCI_CALLTIPACTIVE -SCI_CALLTIPPOSSTART -SCI_CALLTIPSETHLT(int highlightstart, int highlightend) -SCI_CALLTIPSETBACK(int colour) -- - Call tips are small windows displaying the arguments to a function - and are displayed after the user has typed the name of the - function. As the user types values for each argument, the - name of the argument currently being entered is highlighted. + + + Calltips +++ Call tips are small windows displaying the arguments to a function + and are displayed after the user has typed the name of the + function. There is some interaction between call tips and autocompletion + lists in that showing a call tip cancels any active autocompletion + list, and vice versa. +
+ Call tips can highlight part of the text within them. You could use
+ this to highlight the current argument to a function by counting the
+ number of commas (or whatever separator your language uses).
+ See
+ Alternatively, call tips can be displayed when you leave the mouse
+ pointer for a while over a word in response to the +SCI_CALLTIPSHOW(int posStart, const char *definition) +SCI_CALLTIPCANCEL +SCI_CALLTIPACTIVE +SCI_CALLTIPPOSSTART +SCI_CALLTIPSETHLT(int highlightstart, int highlightend) +SCI_CALLTIPSETBACK(int colour) ++
+ SCI_CALLTIPSHOW(int posStart, const char *definition)
+ SCI_CALLTIPCANCEL
+ SCI_CALLTIPACTIVE
+ SCI_CALLTIPPOSSTART
+ SCI_CALLTIPSETHLT(int hlStart, int hlEnd)
+ Unhighlighted text is drawn in a mid grey. Selected text is
+ drawn in a dark blue. The default background is white, but this
+ can be changed with
+ SCI_CALLTIPSETBACK(int colour) + Keyboard commands +
- SCI_CALLTIPSHOW starts the process by displaying the calltip
- window, with the definition argument containing the text to
- display. SCI_CALLTIPPOSSTART returns the value of the current
- position when SCI_CALLTIPSHOW started display of the list.
- SCI_CALLTIPSETHLT sets the region of the calltip text displayed in
- a highlighted style. The background colour of calltips can
- be set with SCI_CALLTIPSETBACK with the default being white.
+ To allow the container application to perform any of the actions available to the
+ user with keyboard, all the keyboard actions are messages. They do not take
+ any parameters. These commands are also used when redefining the key bindings with
+ the - Keyboard Commands ---SCI_LINEDOWN -SCI_LINEDOWNEXTEND -SCI_LINEUP -SCI_LINEUPEXTEND -SCI_CHARLEFT -SCI_CHARLEFTEXTEND -SCI_CHARRIGHT -SCI_CHARRIGHTEXTEND -SCI_WORDLEFT -SCI_WORDLEFTEXTEND -SCI_WORDRIGHT -SCI_WORDRIGHTEXTEND -SCI_HOME -SCI_HOMEEXTEND -SCI_LINEEND -SCI_LINEENDEXTEND -SCI_DOCUMENTSTART -SCI_DOCUMENTSTARTEXTEND -SCI_DOCUMENTEND -SCI_DOCUMENTENDEXTEND -SCI_PAGEUP -SCI_PAGEUPEXTEND -SCI_PAGEDOWN -SCI_PAGEDOWNEXTEND -SCI_EDITTOGGLEOVERTYPE -SCI_CANCEL -SCI_DELETEBACK -SCI_DELETEBACKNOTLINE -SCI_TAB -SCI_BACKTAB -SCI_NEWLINE -SCI_FORMFEED -SCI_VCHOME -SCI_VCHOMEEXTEND -SCI_DELWORDLEFT -SCI_DELWORDRIGHT -SCI_DELLINELEFT -SCI_DELLINERIGHT -SCI_LINESCROLLDOWN -SCI_LINESCROLLUP -SCI_LINECUT -SCI_LINEDELETE -SCI_LINETRANSPOSE -SCI_LINEDUPLICATE -SCI_LOWERCASE -SCI_UPPERCASE -SCI_WORDPARTLEFT -SCI_WORDPARTLEFTEXTEND -SCI_WORDPARTRIGHT -SCI_WORDPARTRIGHTEXTEND -SCI_HOMEDISPLAY -SCI_HOMEDISPLAYEXTEND -SCI_LINEENDDISPLAY -SCI_LINEENDDISPLAYEXTEND -+ +
- To allow the container application to perform any of the actions - available to the user with keyboard, all the keyboard actions are - messages. They do not take any parameters. - + TheSCI_*EXTEND messages extend the selection.
- These commands are also used when redefining the key bindings with
- the SCI_ASSIGNCMDKEY message.
+ The
- The SCI_WORDPART* commands are used to move between word segments
- marked by capitalisation (aCamelCaseIdentifier) or underscores
- (an_under_bar_ident).
+ The - The SCI_[HOME|LINEEND]DISPLAY* commands are used when - in line wrap mode to allow movement to the start or end of display lines - as opposed to the normal [HOME|LINEEND] commands which move - to the start or end of document lines. + + + Key bindings ++
+ There is a default binding of keys to commands that is defined in the
+ Scintilla source in the file +SCI_ASSIGNCMDKEY(int keyDefinition, int sciCommand) +SCI_CLEARCMDKEY(int keyDefinition) +SCI_CLEARALLCMDKEYS +SCI_NULL ++
+ keyDefinition
+ The key code is a visible or control character or a key from the
+
+ The modifiers are a combination of zero or more of
+
+ SCI_ASSIGNCMDKEY(int keyDefinition, int sciCommand)
+ SCI_CLEARCMDKEY(int keyDefinition)
+ SCI_CLEARALLCMDKEYS + The SCI_NULL does nothing and is the value assigned to keys that
+ perform no action.
- - Key Bindings ---SCI_ASSIGNCMDKEY((short key,short modifiers), int message) -SCI_CLEARCMDKEY((short key,short modifiers)) -SCI_CLEARALLCMDKEYS -SCI_NULL -+ + +Popup edit menu +
- There is a default binding of keys to commands in Scintilla which
- can be overridden with these messages.
- To fit the parameters into a message, the first argument contains
- the key code in the low word and the key modifiers (possibly shift
- and control) in the high word. The key code is a visible or control
- character or a key from the SCK_* enumeration,
- which contains SCK_ADD, SCK_BACK, SCK_DELETE, SCK_DIVIDE,
- SCK_DOWN, SCK_END, SCK_ESCAPE, SCK_HOME, SCK_INSERT,
- SCK_LEFT, SCK_NEXT, SCK_PRIOR, SCK_RETURN, SCK_RIGHT,
- SCK_SUBTRACT, SCK_TAB, and SCK_UP.
- The modifiers are a combination of zero or more of
- SCMOD_ALT, SCMOD_CTRL, and SCMOD_SHIFT.
- SCI_NULL does nothing and is the value assigned to keys that
- perform no action.
+ SCI_USEPOPUP(bool bEnablePopup) - Popup edit menu ---SCI_USEPOPUP -+ + +Macro recording +
- Clicking the wrong button on the mouse pops up a short default
- editing menu.
- This may be turned off with SCI_USEPOPUP(0).
+ Start and stop macro recording mode.
+ In macro recording mode, actions are reported to the container through
+ - Macro Recording ---SCI_STARTRECORD -SCI_STOPRECORD -
- Start and stop macro recording mode.
- In macro recording mode, actions are reported to the container through
- SCN_MACRORECORD notifications. It is then up to the container to
- record these actions for future replay.
+ SCI_STARTRECORD - Printing -+ ++Printing +SCI_FORMATRANGE SCI_SETPRINTMAGNIFICATION(int magnification) @@ -1335,57 +2997,62 @@ SCI_SETPRINTCOLOURMODE(int mode) SCI_GETPRINTCOLOURMODE - On Windows SCI_FORMATRANGE can be used to draw the text onto a - display context which can include a printer display context. + On Windows SCI_FORMATRANGE can be used to draw the text onto a + display context which can include a printer display context. - To print at a different size than drawing on screen use - SCI_SETPRINTMAGNIFICATION with a value which is the number of - points to add to each style. -3 or -4 gives reasonable small print. + To print at a different size than drawing on screen use + SCI_SETPRINTMAGNIFICATION with a value which is the number of + points to add to each style. -3 or -4 gives reasonable small print. - If a black background is used on the screen then it is best to - invert the light value of all colours with - SCI_SETPRINTCOLOURMODE(SC_PRINT_INVERTLIGHT) when printing to give - a white background. - If intermediate tones are used on screen then black on white print - can be chosen with SCI_SETPRINTCOLOURMODE(SC_PRINT_BLACKONWHITE). - Other options are the default, SC_PRINT_NORMAL, and - SC_PRINT_COLOURONWHITE and SC_PRINT_COLOURONWHITEDEFAULTBG. + If a black background is used on the screen then it is best to + invert the light value of all colours with + SCI_SETPRINTCOLOURMODE(SC_PRINT_INVERTLIGHT) when printing to give + a white background. + If intermediate tones are used on screen then black on white print + can be chosen with SCI_SETPRINTCOLOURMODE(SC_PRINT_BLACKONWHITE). + Other options are the default, SC_PRINT_NORMAL, and + SC_PRINT_COLOURONWHITE and SC_PRINT_COLOURONWHITEDEFAULTBG. -- Direct Access -+ ++Direct access +SCI_GETDIRECTFUNCTION SCI_GETDIRECTPOINTER - On Windows, the message passing scheme used to communicate between - the container and Scintilla is mediated by the operating system - SendMessage function which can lead to bad performance when - calling intensively. - To avoid this overhead a pointer to a message handling function inside - Scintilla can be retrieved with SCI_GETDIRECTFUNCTION. - The function is also exported from the Windows DLL under the name - 'Scintilla_DirectFunction'. - The first argument to use when calling the returned function is the - value retrieved from SCI_GETDIRECTPOINTER. After that go the - message number, wParam, and lParam. + On Windows, the message passing scheme used to communicate between + the container and Scintilla is mediated by the operating system + SendMessage function which can lead to bad performance when + calling intensively. + To avoid this overhead a pointer to a message handling function inside + Scintilla can be retrieved with SCI_GETDIRECTFUNCTION. + The first argument to use when calling the returned function is the + value retrieved from SCI_GETDIRECTPOINTER. After that go the + message number, wParam, and lParam. - While faster, this direct calling will cause problems if performed - from a different thread to the native thread of the Scintilla - window in which case SendMessage should be used to synchronize with - the window's thread. + While faster, this direct calling will cause problems if performed + from a different thread to the native thread of the Scintilla + window in which case SendMessage should be used to synchronize with + the window's thread. - This feature also works on GTK+ but has no significant impact on - speed. + This feature also works on GTK+ but has no significant impact on + speed. -- Multiple Views -++ From version 1.47 on Windows, Scintilla exports a function called + Scintilla_DirectFunction that can be used the same as the function returned by + SCI_GETDIRECTFUNCTION. + + ++Multiple views +SCI_GETDOCPOINTER SCI_SETDOCPOINTER(<unused>,document *pdoc) @@ -1394,28 +3061,29 @@ SCI_ADDREFDOCUMENT(<unused>,document *pdoc) SCI_RELEASEDOCUMENT(<unused>,document *pdoc) - This is to allow simple split views of documents and so - applications may maintain multiple buffer which may be - individually selected into the editor. Each Scintilla has a pointer - to a used document. - Initially the used document is a default one created when the - Scintilla was created. - The SCI_GETDOCPOINTER call returns a pointer to the used document. - SCI_SETDOCPOINTER sets the used document. - SCI_SETDOCPOINTER(0) switches to a new empty document. - Before closing down Scintilla make sure all document pointers - retrieved are released to avoid memory leaks. - -- A new document may be created by SCI_CREATEDOCUMENT which returns a - pointer to the document. This document is not selected into the - editor and starts with a reference count of 1. A document may be - released with SCI_RELEASEDOCUMENT and have its reference count - incremented with SCI_ADDREFDOCUMENT. + This is to allow simple split views of documents and so + applications may maintain multiple buffer which may be + individually selected into the editor. Each Scintilla has a pointer + to a used document. + Initially the used document is a default one created when the + Scintilla was created. + The SCI_GETDOCPOINTER call returns a pointer to the used document. + SCI_SETDOCPOINTER sets the used document. + SCI_SETDOCPOINTER(0) switches to a new empty document. + Before closing down Scintilla make sure all document pointers + retrieved are released to avoid memory leaks. -- Folding -++ A new document may be created by SCI_CREATEDOCUMENT which returns a + pointer to the document. This document is not selected into the + editor and starts with a reference count of 1. A document may be + released with SCI_RELEASEDOCUMENT and have its reference count + incremented with SCI_ADDREFDOCUMENT. + + ++Folding +SCI_VISIBLEFROMDOCLINE(int docLine) SCI_DOCLINEFROMVISIBLE(int displayLine) @@ -1434,106 +3102,108 @@ SCI_ENSUREVISIBLE(int line) SCI_ENSUREVISIBLEENFORCEPOLICY(int line) - The fundamental operation in folding is making lines invisible or - visible. - Line visibility is a property of the view rather than the document - so each view may be displaying a different set of lines. - SCI_SHOWLINES and SCI_HIDELINES show or hide a range of lines. - SCI_GETLINEVISIBLE determines whether a line is visible. - When some lines are hidden, then a particular line in the document - may be displayed at a different position to its document position. - SCI_VISIBLEFROMDOCLINE and SCI_DOCLINEFROMVISIBLE map from - document line to display line and back. - -- Generally the fold points of a document are based on the - hierarchical structure of the contents of the document. - In Python, the hierarchy is determined by indentation and in C++ - by brace characters. This hierarchy can be represented within a - Scintilla document object by attaching a numeric level to each - line. - The initial level of a file is SC_FOLDLEVELBASE to allow unsigned - arithmetic on levels. The SC_FOLDLEVELNUMBERMASK constant can be - used to mask out the other bits to reveal the fold level number. - There are also two bit flags associated with each line. - SC_FOLDLEVELWHITEFLAG indicates that the line is blank and allows - it to be treated slightly different then its level may indicate. - For example, blank lines should generally not be fold points. - SC_FOLDLEVELHEADERFLAG indicates that the line is a header or fold - point. - -- The hierarchy can be navigated just through SCI_GETFOLDLEVEL, but - it is often useful to find the parent of a line (SCI_GETFOLDPARENT) - or the line that is the last child of a line (SCI_GETLASTCHILD). - -- Each fold point may be either expanded, displaying all its child - lines, or contracted, hiding all the child lines. This is per view - state and can be manipulated with SCI_SETFOLDEXPANDED and - SCI_GETFOLDEXPANDED. Using SCI_SETFOLDEXPANDED does not show or - hide any lines but only changes a state flag and the margin markers - that show the contraction state. SCI_TOGGLEFOLD performs the - expansion or contraction of a fold point in the manner normally - expected. - -- A hidden line may be hidden because more than one of its parent - lines is contracted. SCI_ENSUREVISIBLE travels up the fold - hierarchy, expanding any contracted folds until it reaches the top - level. The line will then be visible. - -- The fold flags is a set of bit flags set with the SCI_SETFOLDFLAGS - message to determine where folding lines are drawn. 2 is draw above - if expanded, 4 is draw above if not expanded. 8 is draw below if - expanded and 16 is draw below if not expanded. - 64 is display hexadecimal fold levels in line margin to aid debugging folding. - This feature needs to be redesigned to be sensible. + The fundamental operation in folding is making lines invisible or + visible. + Line visibility is a property of the view rather than the document + so each view may be displaying a different set of lines. + SCI_SHOWLINES and SCI_HIDELINES show or hide a range of lines. + SCI_GETLINEVISIBLE determines whether a line is visible. + When some lines are hidden, then a particular line in the document + may be displayed at a different position to its document position. + SCI_VISIBLEFROMDOCLINE and SCI_DOCLINEFROMVISIBLE map from + document line to display line and back. + ++ Generally the fold points of a document are based on the + hierarchical structure of the contents of the document. + In Python, the hierarchy is determined by indentation and in C++ + by brace characters. This hierarchy can be represented within a + Scintilla document object by attaching a numeric level to each + line. + The initial level of a file is SC_FOLDLEVELBASE to allow unsigned + arithmetic on levels. The SC_FOLDLEVELNUMBERMASK constant can be + used to mask out the other bits to reveal the fold level number. + There are also two bit flags associated with each line. + SC_FOLDLEVELWHITEFLAG indicates that the line is blank and allows + it to be treated slightly different then its level may indicate. + For example, blank lines should generally not be fold points. + SC_FOLDLEVELHEADERFLAG indicates that the line is a header or fold + point. + ++ The hierarchy can be navigated just through SCI_GETFOLDLEVEL, but + it is often useful to find the parent of a line (SCI_GETFOLDPARENT) + or the line that is the last child of a line (SCI_GETLASTCHILD). + ++ Each fold point may be either expanded, displaying all its child + lines, or contracted, hiding all the child lines. This is per view + state and can be manipulated with SCI_SETFOLDEXPANDED and + SCI_GETFOLDEXPANDED. Using SCI_SETFOLDEXPANDED does not show or + hide any lines but only changes a state flag and the margin markers + that show the contraction state. SCI_TOGGLEFOLD performs the + expansion or contraction of a fold point in the manner normally + expected. + ++ A hidden line may be hidden because more than one of its parent + lines is contracted. SCI_ENSUREVISIBLE travels up the fold + hierarchy, expanding any contracted folds until it reaches the top + level. The line will then be visible. + ++ The fold flags is a set of bit flags set with the SCI_SETFOLDFLAGS + message to determine where folding lines are drawn. 2 is draw above + if expanded, 4 is draw above if not expanded. 8 is draw below if + expanded and 16 is draw below if not expanded. + 64 is display hexadecimal fold levels in line margin to aid debugging folding. + This feature needs to be redesigned to be sensible. -- Line Wrapping -+ ++ Line wrapping +SCI_SETWRAPMODE(SC_WRAP_NONE or SC_WRAP_WORD) SCI_GETWRAPMODE - When the wrap mode is set to SC_WRAP_WORD lines wider than the - window width are continued on the following lines. Lines are - broken after space or tab characters or between runs of different - styles. If this is not possible because a word in one style is - wider than the window then the break occurs before after the last - character that completely fits on the line. - The horizontal scroll bar does not appear when wrap mode is on. + When the wrap mode is set to SC_WRAP_WORD lines wider than the + window width are continued on the following lines. Lines are + broken after space or tab characters or between runs of different + styles. If this is not possible because a word in one style is + wider than the window then the break occurs before after the last + character that completely fits on the line. + The horizontal scroll bar does not appear when wrap mode is on. SCI_SETLAYOUTCACHE(SC_CACHE_NONE or SC_CACHE_CARET or SC_CACHE_PAGE or SC_CACHE_DOCUMENT) SCI_GETLAYOUTCACHE - 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 does not change. - To avoid these unnecessary calculations in some circumstances, the line - layout cache can store the results of the calculations. - The cache in invalidated whenever the underlying data, such as the contents - or styling of the document changes. - Caching the layout of the whole document has the most effect, making dynamic - line wrap as much as 20 times faster but this requires 7 times the memory - required by the document contents. - -- SC_CACHE_NONE performs no caching and is the default. - SC_CACHE_CARET caches the layout information for the line containing the - caret. - SC_CACHE_PAGE caches the layout of the visible lines and the caret - line. - SC_CACHE_DOCUMENT caches the layout of the entire document. + 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 does not change. + To avoid these unnecessary calculations in some circumstances, the line + layout cache can store the results of the calculations. + The cache in invalidated whenever the underlying data, such as the contents + or styling of the document changes. + Caching the layout of the whole document has the most effect, making dynamic + line wrap as much as 20 times faster but this requires 7 times the memory + required by the document contents. -- Zooming -++ SC_CACHE_NONE performs no caching and is the default. + SC_CACHE_CARET caches the layout information for the line containing the + caret. + SC_CACHE_PAGE caches the layout of the visible lines and the caret + line. + SC_CACHE_DOCUMENT caches the layout of the entire document. + + ++ Zooming +SCI_ZOOMIN SCI_ZOOMOUT @@ -1541,16 +3211,17 @@ SCI_SETZOOM SCI_GETZOOM - The text can be made larger and smaller by using SCI_ZOOMIN and - SCI_ZOOMOUT. - The zoom level can be retrieved by SCI_GETZOOM and set by - SCI_SETZOOM. - The zoom factors may range from -10 to + 20 and is added to each - styles point size. The calculated point size never goes below 2. + The text can be made larger and smaller by using SCI_ZOOMIN and + SCI_ZOOMOUT. + The zoom level can be retrieved by SCI_GETZOOM and set by + SCI_SETZOOM. + The zoom factors may range from -10 to + 20 and is added to each + styles point size. The calculated point size never goes below 2. -- Long Lines -+ ++Long lines +SCI_GETEDGECOLUMN SCI_SETEDGECOLUMN(int column) @@ -1560,18 +3231,19 @@ SCI_GETEDGECOLOUR SCI_SETEDGECOLOUR(int colour) - This mechanism marks lines that are longer than a specified length - in one of two ways. A vertical line can be displayed at the - specified column number (EDGE_LINE) or characters after that - column can be displayed with a specified background colour - (EDGE_BACKGROUND). The vertical line works well for monospaced - fonts but not for proportional fonts which should use - EDGE_BACKGROUND. The default is to not have any form of long line - marking (EDGE_NONE). + This mechanism marks lines that are longer than a specified length + in one of two ways. A vertical line can be displayed at the + specified column number (EDGE_LINE) or characters after that + column can be displayed with a specified background colour + (EDGE_BACKGROUND). The vertical line works well for monospaced + fonts but not for proportional fonts which should use + EDGE_BACKGROUND. The default is to not have any form of long line + marking (EDGE_NONE). -- Lexer -+ ++ Lexer +SCI_SETLEXER(int lexer) SCI_SETLEXERLANGUAGE(<unused>, char *name) @@ -1581,66 +3253,67 @@ SCI_SETPROPERTY(char *key, char *value) SCI_SETKEYWORDS(int keywordset, char *keywordlist) - If the SciLexer version of Scintilla is used, then lexing support - for some programming languages is included. A particular lexer may - be chosen from the SCLEX* enumeration and it is invoked - automatically to style the document as required. Lexers can also - be chosen by string name rather than by integer ID. - If the lexer is set to SCLEX_CONTAINER then the container is - notified to perform styling as is the case with the standard - Scintilla.DLL version. Styling may be requested for a range of the - document by using SCI_COLOURISE. - -- Settings can be communicated to the lexers using SCI_SETPROPERTY. - Currently the "fold" property is defined for most of the lexers to - set the fold structure if set to "1". SCLEX_PYTHON understands - "tab.timmy.whinge.level" as a setting that determines how to - indicate bad indentation. Many languages style a set of keywords - distinctly from other words. Some languages, such as HTML may - contain embedded languages, VBScript and Javascript are common for - HTML. SCI_SETKEYWORDS specifies the keywords separated by spaces. - For HTML, key word set is for HTML, 1 is for Javascript and 2 is - for VBScript. + If the SciLexer version of Scintilla is used, then lexing support + for some programming languages is included. A particular lexer may + be chosen from the SCLEX* enumeration and it is invoked + automatically to style the document as required. Lexers can also + be chosen by string name rather than by integer ID. + If the lexer is set to SCLEX_CONTAINER then the container is + notified to perform styling as is the case with the standard + Scintilla.DLL version. Styling may be requested for a range of the + document by using SCI_COLOURISE. + ++ Settings can be communicated to the lexers using SCI_SETPROPERTY. + Currently the "fold" property is defined for most of the lexers to + set the fold structure if set to "1". SCLEX_PYTHON understands + "tab.timmy.whinge.level" as a setting that determines how to + indicate bad indentation. Many languages style a set of keywords + distinctly from other words. Some languages, such as HTML may + contain embedded languages, VBScript and Javascript are common for + HTML. SCI_SETKEYWORDS specifies the keywords separated by spaces. + For HTML, key word set 0 is for HTML, 1 is for Javascript and 2 is + for VBScript. -- Notifications -+ ++ Notifications +- Notifications are sent (fired) from the Scintilla control to its - container when an event has occurred that may interest the - container. Notifications are sent using the WM_NOTIFY message on - Windows and the "notify" signal on GTK+ with a structure containing - information about the event. + Notifications are sent (fired) from the Scintilla control to its + container when an event has occurred that may interest the + container. Notifications are sent using the WM_NOTIFY message on + Windows and the "notify" signal on GTK+ with a structure containing + information about the event. SCN_STYLENEEDED(int endstyleneeded) - Before displaying a page or printing, this message is sent to the - container. It is a good opportunity for the container to ensure - that syntax styling information for the visible text. + Before displaying a page or printing, this message is sent to the + container. It is a good opportunity for the container to ensure + that syntax styling information for the visible text. SCN_UPDATEUI SCN_CHECKBRACE - Either the text or styling of the document has changed or the - selection range has changed. Now would be a good time to update - any container UI elements that depend on document or view state. - Was previously called SCN_CHECKBRACE because a common use is to - check whether the caret is next to a brace and set highlights on - this brace and its corresponding matching brace. + Either the text or styling of the document has changed or the + selection range has changed. Now would be a good time to update + any container UI elements that depend on document or view state. + Was previously called SCN_CHECKBRACE because a common use is to + check whether the caret is next to a brace and set highlights on + this brace and its corresponding matching brace. SCN_CHARADDED(int charadded) - Fired when the user types an ordinary text character (as opposed - to a command character) which is entered into the text. - Can be used by the container to decide to display a call tip or - auto completion list. + Fired when the user types an ordinary text character (as opposed + to a command character) which is entered into the text. + Can be used by the container to decide to display a call tip or + auto completion list. SCN_POSCHANGED(int newPos) @@ -1652,55 +3325,49 @@ SCN_POSCHANGED(int newPos)SCN_SAVEPOINTREACHED SCN_SAVEPOINTLEFT -SCI_SETSAVEPOINT |