Page 12 of 20
Re: GoScintilla - 2.0 (beta 4)
Posted: Tue Jul 20, 2010 4:13 pm
by Peyman

Many Thanks Srod for your time, now Works very good.
is this possible in future we add these with GOSCI_AddDelimiter (support more than one character) ?
Re: GoScintilla - 2.0 (beta 4)
Posted: Tue Jul 20, 2010 4:16 pm
by srod
Peyman wrote:

Many Thanks Srod for your time, now Works very good.
is this possible in future we add these with GOSCI_AddDelimiter (support more than one character) ?
Adding that kind of support natively will really slow GoScintilla down for those cases where only single delimiters/separators are required and so I will not consider doing that no. The user-defined line styling functions are there for this kind of thing anyhow and whilst they are a bit fiddly to use, you soon get used to them. You have to accept that Scintilla, in terms of syntax highlighting etc, is not an easy thing to use regardless.
You must also keep in mind that I wrote GoScintilla firstly for my own use and I have no need for multiple-character delimiters!

Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Thu Jul 22, 2010 12:10 pm
by srod
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.
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Thu Jul 22, 2010 3:36 pm
by ts-soft
Thanks, i will test it on this weekend.
Greetings
Thomas
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Mon Aug 02, 2010 5:27 pm
by Peyman
thanks srod for your time.

Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Fri Aug 20, 2010 1:44 pm
by cybergeek
i want to add c++ comments delimieter .. that is "//"
but goscintilla doesnt seem to allow this.. i think delimieters are only single charred...
plus i also want to use "/" in my #STYLES_Operators list ..
GOSCI_AddDelimiter(1, "//", "", #GOSCI_DELIMITTOENDOFLINE|#GOSCI_NONSEPARATINGDELIMITER, #STYLES_COMMENTS)
can u help me with adding // delimieters to add commenting style for c++ code?
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Fri Aug 20, 2010 1:54 pm
by srod
You are correct, GoScintilla allows only single character separators/delimiters. You need to use a user-defined line styling function.
Have a look at the "BlockCommentStylerII.pb" demo which implements c-style block comments and // delimited line comments.
Demos\AdvancedDemos\BlockComments\BlockCommentStylerII.pb
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Fri Aug 20, 2010 2:23 pm
by cybergeek
thx................
another question:
how can i make "public" or "private" or "protected" highlighted when they combine with ":" operator in a class definition
e.g
class person
{
public: // public is not highlighted with ":"
}

Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Fri Aug 20, 2010 2:41 pm
by srod
Either declare : as a separator or some kind of delimiter or add Public: (with the colon) to the keyword list etc.
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Fri Aug 20, 2010 3:21 pm
by cybergeek
this worked
GOSCI_SetLexerOption(1, #GOSCI_LEXEROPTION_SEPARATORSYMBOLS, @"=+-*/%()[],.:")
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Wed Aug 25, 2010 11:04 am
by cybergeek
have u debugged GOSCI_CopyLexerFromExistingControl(ID, sourceID)
it returns invalid memory access error

Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Wed Aug 25, 2010 11:17 am
by srod
Works fine here.
What version of PB are you using?
GoScintilla 2.1 requires PB 4.5 (as made clear at the nxSoftware site); although the function you are trying to use will only work with PB 4.51 RC 2.
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Wed Aug 25, 2010 11:34 am
by cybergeek
srod wrote:Works fine here.
What version of PB are you using?
GoScintilla 2.1 requires PB 4.5 (as made clear at the nxSoftware site); although the function you are trying to use will only work with PB 4.51 RC 2.
pb 4.50 x86
cant me made to work on 4.50 ?
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Wed Aug 25, 2010 12:01 pm
by srod
Nope. A bug with PB 4.50 prevents that.
Either upgrade or do not use the copying lexer function. To be honest, I really see no need for the function anyhow since you can just use a function which does the job of adding all keywords etc. Just call the function for each Scintilla control you wish to utilise.
Re: GoScintilla - 2.1 (Purebasic 4.5 only)
Posted: Wed Aug 25, 2010 12:33 pm
by cybergeek
yes i have made an AddLexer function
===================================
i have encountered a really mysterious problem (i think it is)
i have PMed u the code
Run the code - goto File -> Open - select any source file
it will create a new tab with that filename and try to load it with source code but that doesnt work at all .. i cant figure it out!