Browse Source

Fix NullReferenceException when hovering over ChangeMarkerMargin in a text file without syntax highlighting.

pull/39/merge
Daniel Grunwald 13 years ago
parent
commit
3841dbf8a1
  1. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DiffControl.xaml.cs

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/DiffControl.xaml.cs

@ -48,6 +48,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
{ {
string language = source.SyntaxHighlighting != null ? source.SyntaxHighlighting.Name : null; string language = source.SyntaxHighlighting != null ? source.SyntaxHighlighting.Name : null;
editor.TextArea.TextView.LineTransformers.RemoveWhere(x => x is HighlightingColorizer); editor.TextArea.TextView.LineTransformers.RemoveWhere(x => x is HighlightingColorizer);
if (source.SyntaxHighlighting != null)
editor.TextArea.TextView.LineTransformers.Insert(0, new CustomizableHighlightingColorizer(source.SyntaxHighlighting.MainRuleSet, CustomizedHighlightingColor.FetchCustomizations(language))); editor.TextArea.TextView.LineTransformers.Insert(0, new CustomizableHighlightingColorizer(source.SyntaxHighlighting.MainRuleSet, CustomizedHighlightingColor.FetchCustomizations(language)));
CustomizableHighlightingColorizer.ApplyCustomizationsToDefaultElements(editor, CustomizedHighlightingColor.FetchCustomizations(language)); CustomizableHighlightingColorizer.ApplyCustomizationsToDefaultElements(editor, CustomizedHighlightingColor.FetchCustomizations(language));
HighlightingOptions.ApplyToRendering(editor, CustomizedHighlightingColor.FetchCustomizations(language)); HighlightingOptions.ApplyToRendering(editor, CustomizedHighlightingColor.FetchCustomizations(language));

Loading…
Cancel
Save