Refactor properties highlighting for consistency and clarity

This commit is contained in:
ema
2025-06-29 09:04:25 +08:00
parent 9a17d5fa0f
commit e16a89f979
2 changed files with 12 additions and 6 deletions

View File

@@ -50,13 +50,13 @@ public class PropertiesHighlightingDefinition : DarkHighlightingDefinition
Name = "Comment",
Foreground = new SimpleHighlightingBrush("#6A9949".ToColor()),
},
_ => null
_ => null,
};
}
public override IEnumerable<HighlightingColor> NamedHighlightingColors =>
[
GetNamedColor("Comment")
GetNamedColor("Comment"),
];
public override DocumentColorizingTransformer[] LineTransformers { get; } = [new KeyHighlighter()];
@@ -75,7 +75,10 @@ public class PropertiesHighlightingDefinition : DarkHighlightingDefinition
if (idx <= 0)
return;
ChangeLinePart(line.Offset, line.Offset + idx, el => el.TextRunProperties.SetForegroundBrush("#3F9CD6".ToBrush()));
ChangeLinePart(line.Offset, line.Offset + idx, el =>
{
el.TextRunProperties.SetForegroundBrush("#3F9CD6".ToBrush());
});
}
}
}

View File

@@ -51,13 +51,13 @@ public class PropertiesHighlightingDefinition : LightHighlightingDefinition
Name = "Comment",
Foreground = new SimpleHighlightingBrush(Colors.Green),
},
_ => null
_ => null,
};
}
public override IEnumerable<HighlightingColor> NamedHighlightingColors =>
[
GetNamedColor("Comment")
GetNamedColor("Comment"),
];
public override DocumentColorizingTransformer[] LineTransformers { get; } = [new KeyHighlighter()];
@@ -76,7 +76,10 @@ public class PropertiesHighlightingDefinition : LightHighlightingDefinition
if (idx <= 0)
return;
ChangeLinePart(line.Offset, line.Offset + idx, el => el.TextRunProperties.SetForegroundBrush(Colors.Blue.ToBrush()));
ChangeLinePart(line.Offset, line.Offset + idx, el =>
{
el.TextRunProperties.SetForegroundBrush(Colors.Blue.ToBrush());
});
}
}
}