I want to cascade the SyntaxHighlighting Engine of AvalonEdit. I have 2 HighlightingDefinitions
. The first one is the main syntax. The second one is a complex multiline-preprocessor-markup-language. For this reason it is too complicated to embbed the second grammar in the first one. The easier way is to render the first syntax, and change the affected line-parts (based on the second syntax) afterwards.
So I instantiated a new HighlightingColorizer
with the second language and added it to the LineTransformers
. But the second language colorizes the complete document and not only the lineparts with the preprocessor-directives: the non-preprocessor-code is black.
As I debugged the ColorizeLine
-method of the second line transformer, the lines of the non-highlighted code (= no preprocessor code) have not been colorized, as expected. But the color of the lines are black.
So does the HighlightingColorizer
reset all previous highlighting of the whole document before it starts to colorize?
Or what else could be the problem? How can I properly cascade 2 HighlightingColorizers
?