|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Consistent styles across different lexersHi,
I'm writing an editor on top of scintilla (not enough of that done IMO :), and I'd like specified styles to stay consistent across languages. For example, if I specify that keywords should be blue and bold, I'd like that to be true for all supported languages (where it makes sense). I can't find an easy way to do this, since different id's mean different things in different lexers (brief excerpt below). Is there something I'm missing? STC_PS_NAME 5 STC_P_WORD 5 STC_SCRIPTOL_COMMENTBLOCK 5 STC_SH_STRING 5 STC_T3_OPERATOR 5 STC_TCL_IN_QUOTE 5 STC_TEX_TEXT 5 STC_VHDL_OPERATOR 5 STC_V_WORD 5 |
|
|
Re: Consistent styles across different lexersdan.sg wrote:
> I'm writing an editor on top of scintilla (not enough of that done IMO :), > and I'd like specified styles to stay consistent across languages. > > For example, if I specify that keywords should be blue and bold, I'd like > that to be true for all supported languages (where it makes sense). I can't > find an easy way to do this, since different id's mean different things in > different lexers (brief excerpt below). > > Is there something I'm missing? Just look at the way, say, SciTE does it - you effectively add a level of indirection. This means that for each language-specific .properties file (to follow SciTE's conventions), you just map specific styles in that lexer to values like, e.g., "$(font.base)" or "$(colour.operator)". That way, in a global .properties file, you can define all the common values for font face, weight, color, etc. to values that all your supported can share (when it makes sense). You can take a look at the global definitions in SciTEGlobal.properties and see how those are used by some of the individual lexer .properties files. Robert Roessler robertr@... http://www.rftp.com _______________________________________________ Scintilla-interest mailing list Scintilla-interest@... http://mailman.lyra.org/mailman/listinfo/scintilla-interest |
|
|
|
|
|
Re: Re: Consistent styles across different lexersDan G wrote:
> I was hoping to not have to roll my own level of indirection, but as > long as I'm doing it, is there any interest in having this work somehow > be contributed back to the project? I imagine anyone writing an editor > on top of scintilla has to do this. There may be some misunderstanding here - as I was just mentioning how SciTE does this as *an* example of how to share style information across multiple lexers, there are 2 things to note: 1) the data structures/interpretation are in the editor ("container"), not in Scintilla 2) *this* functionality is already present in SciTE, so it isn't entirely clear where you would make your contribution... ;) Robert Roessler robertr@... http://www.rftp.com _______________________________________________ Scintilla-interest mailing list Scintilla-interest@... http://mailman.lyra.org/mailman/listinfo/scintilla-interest |
|
|
Re: Re: Consistent styles across different lexers Languages differ greatly in which elements and element
relationships are considered important. Scintilla could provide a few common flags (Comment/Identifier/Literal) for each style but this would only provide minimal guidance to containers. For example, in C there are string and character literals but other languages (such as Python) don't need to make that distinction and may instead prefer to differentiate between short and multi-line-capable literals. Or the user may want to use ' versus " to indicate whether a literal requires translation. I doubt there is anything achievable with reasonable effort that will greatly assist over the range of languages supported by Scintilla. Neil _______________________________________________ Scintilla-interest mailing list Scintilla-interest@... http://mailman.lyra.org/mailman/listinfo/scintilla-interest |
|
|
|
| Free embeddable forum powered by Nabble | Forum Help |