Browse Source

Fixed customized syntax highlightings.

4.0
Daniel Grunwald 14 years ago
parent
commit
ce785fda34
  1. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs
  2. 3
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/BracketHighlightRenderer.cs
  3. 1
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs
  4. 3
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CustomizableHighlightingColorizer.cs
  5. 11
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/CustomizedHighlightingItem.cs

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/AvalonEditViewContent.cs

@ -136,7 +136,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -136,7 +136,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
isLoading = true;
try {
BookmarksDetach();
codeEditor.PrimaryTextEditor.SyntaxHighlighting =
codeEditor.SyntaxHighlighting =
HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(file.FileName));
if (!file.IsUntitled) {

3
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/BracketHighlightRenderer.cs

@ -83,6 +83,9 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -83,6 +83,9 @@ namespace ICSharpCode.AvalonEdit.AddIn
foreach (CustomizedHighlightingColor color in customizations) {
if (color.Name == BracketHighlight) {
renderer.UpdateColors(color.Background ?? Colors.Blue, color.Foreground ?? Colors.Blue);
// 'break;' is necessary because more specific customizations come first in the list
// (language-specific customizations are first, followed by 'all languages' customizations)
break;
}
}
}

1
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CodeEditor.cs

@ -314,6 +314,7 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -314,6 +314,7 @@ namespace ICSharpCode.AvalonEdit.AddIn
secondaryTextEditor.SetBinding(TextEditor.IsReadOnlyProperty,
new Binding(TextEditor.IsReadOnlyProperty.Name) { Source = primaryTextEditor });
secondaryTextEditor.SyntaxHighlighting = primaryTextEditor.SyntaxHighlighting;
secondaryTextEditor.UpdateCustomizedHighlighting();
gridSplitter = new GridSplitter {
Height = 4,

3
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/CustomizableHighlightingColorizer.cs

@ -35,6 +35,9 @@ namespace ICSharpCode.AvalonEdit.AddIn @@ -35,6 +35,9 @@ namespace ICSharpCode.AvalonEdit.AddIn
textEditor.TextArea.ClearValue(TextArea.SelectionForegroundProperty);
textEditor.TextArea.TextView.ClearValue(TextView.NonPrintableCharacterBrushProperty);
// 'assigned' flags are used so that the first matching customization wins.
// This is necessary because more specific customizations come first in the list
// (language-specific customizations are first, followed by 'all languages' customizations)
bool assignedDefaultText = false;
bool assignedSelectedText = false;
bool assignedNonPrintableCharacter = false;

11
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/Options/CustomizedHighlightingItem.cs

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Collections.Generic;
using System.Windows.Media;
@ -191,6 +191,7 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options @@ -191,6 +191,7 @@ namespace ICSharpCode.AvalonEdit.AddIn.Options
public override string ToString()
{
return this.Name; }
return this.Name;
}
}
}
}

Loading…
Cancel
Save