@ -282,11 +282,14 @@ namespace ICSharpCode.AvalonEdit.Highlighting
Debug . Assert ( position = = firstMatch . Index ) ;
Debug . Assert ( position = = firstMatch . Index ) ;
if ( firstMatch = = endSpanMatch ) {
if ( firstMatch = = endSpanMatch ) {
PopColor ( ) ; // pop SpanColor
HighlightingSpan poppedSpan = spanStack . Peek ( ) ;
HighlightingSpan poppedSpan = spanStack . Peek ( ) ;
if ( ! poppedSpan . SpanColorIncludesEnd )
PopColor ( ) ; // pop SpanColor
PushColor ( poppedSpan . EndColor ) ;
PushColor ( poppedSpan . EndColor ) ;
position = firstMatch . Index + firstMatch . Length ;
position = firstMatch . Index + firstMatch . Length ;
PopColor ( ) ; // pop EndColor
PopColor ( ) ; // pop EndColor
if ( poppedSpan . SpanColorIncludesEnd )
PopColor ( ) ; // pop SpanColor
spanStack = spanStack . Pop ( ) ;
spanStack = spanStack . Pop ( ) ;
currentRuleSet = this . CurrentRuleSet ;
currentRuleSet = this . CurrentRuleSet ;
//FreeMatchArray(matches);
//FreeMatchArray(matches);
@ -312,10 +315,13 @@ namespace ICSharpCode.AvalonEdit.Highlighting
currentRuleSet = this . CurrentRuleSet ;
currentRuleSet = this . CurrentRuleSet ;
storedMatchArrays . Push ( matches ) ;
storedMatchArrays . Push ( matches ) ;
matches = AllocateMatchArray ( currentRuleSet . Spans . Count ) ;
matches = AllocateMatchArray ( currentRuleSet . Spans . Count ) ;
if ( newSpan . SpanColorIncludesStart )
PushColor ( newSpan . SpanColor ) ;
PushColor ( newSpan . StartColor ) ;
PushColor ( newSpan . StartColor ) ;
position = firstMatch . Index + firstMatch . Length ;
position = firstMatch . Index + firstMatch . Length ;
PopColor ( ) ;
PopColor ( ) ;
PushColor ( newSpan . SpanColor ) ;
if ( ! newSpan . SpanColorIncludesStart )
PushColor ( newSpan . SpanColor ) ;
}
}
endSpanMatch = null ;
endSpanMatch = null ;
}
}