title: AvalonEdit: Cascading HighlightingColorizers
body: <p>I want to cascade the SyntaxHighlighting Engine of AvalonEdit. I have 2 <code>HighlightingDefinitions</code>. 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.</p>
  
  <p>So I instantiated a new <code>HighlightingColorizer</code> with the second language and added it to the <code>LineTransformers</code>. But the second language colorizes the complete document and not only the lineparts with the preprocessor-directives: the non-preprocessor-code is black.</p>
  
  <p>As I debugged the <code>ColorizeLine</code>-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.</p>
  
  <p>So does the <code>HighlightingColorizer</code> reset all previous highlighting of the whole document before it starts to colorize?</p>
  
  <p>Or what else could be the problem? How can I properly cascade 2 <code>HighlightingColorizers</code>?</p>