1

I'm trying to use the Scintilla editing component (actually using python QScintilla, but that shouldn't matter here) to edit more-or-less plain text (not a programming language or other structured text).

Nonetheless I have some structures that can be identified and could be rendered in a different style. This is not a problem as I already implemented what is necessary.

Problem is some of these structures may nest; in particular some "keywords" should be recognized (and highlighted) even inside "quotation marks" (which is highlighted in a different way).

Is there any way of "composing" the styles? i.e.: if text inside quotation has green background and keyword has bold red foreground is there a "simple" way to have a keyword in quotation as "green background and bold red foreground"?

I am aware I can define styles which are "keyword_in_quotes" and manually get the needed effect; I was wondering if there is some built in support in scintilla.

Misinahaiya
  • 502
  • 2
  • 17
ZioByte
  • 2,690
  • 1
  • 32
  • 68
  • Hi ZioByte. I don't know the immediate answer to your question. Nevertheless, I think you can find interesting information on the following website: https://qscintilla.com/ – K.Mulier May 08 '17 at 06:58
  • Sadly you cannot *composite* a style to another. Your only way to achieve this functionality is to sub-class a `QsciLexerCustom`, then override `virtual` method `styleText(int start, int end)`, then highlight the string, keywords and structures by your own from *scratch*. Believed that You've already subclassed and this should be not difficult to achieve. – Misinahaiya Aug 27 '23 at 13:47

0 Answers0