GoScintilla 2.1 - 22nd July 2010
Purebasic 4.5 only.
GoScintilla 2.1 fixes some bugs, adds a new state option (#GOSCI_RESTYLEDOCUMENT to force a complete restyle of the underlying document) and the ability to copy all lexer settings from one control to another.
The new function
GOSCI_CopyLexerFromExistingControl() copies all lexer settings (well, most of them anyhow) from one control to another. This is a hard-copy (by-value) in that a snapshot is taken of the source lexer and copied across to the destination lexer. Any future alterations made to the source lexer will not be subsequently copied across to the destination lexer etc. (unless you use this function again). I have no intention, at this stage, of adding a facility to allow multiple controls to effectively use the same lexer (by reference) as this will force me down a path of 'reference counting' and I don't want to get into that with this library.
It remains to be seen how useful this function will be since it would probably be just as easy to use a generic function to set-up a lexer for your GoScintilla controls anyhow.
The function will copy the following components of a styling lexer :
- all keywords, call-tips, delimiters, separators etc.
- lexer state settings (e.g. #GOSCI_LEXERSTATE_ENABLECODEFOLDING). This means that, for example, if the source lexer has code-completion enabled, then the destination lexer will then inherit this setting.
- user-defined line styling functions.
- style indexes and style definitions (even the default style and line number styling etc).
This includes font definitions, colours and so on.
The function will not copy information on markers or bookmarks. This means, for example, that any colours set for folding markers or bookmarks will not be copied across.
Please see the nxSoftware site for the download.
I may look like a mule, but I'm not a complete ass.