mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-01-14 07:06:15 +08:00
Refactor property key highlighting logic
This commit is contained in:
@@ -67,19 +67,15 @@ public class PropertiesHighlightingDefinition : DarkHighlightingDefinition
|
||||
{
|
||||
var text = CurrentContext.Document.GetText(line);
|
||||
|
||||
if (!text.TrimStart().StartsWith("#"))
|
||||
{
|
||||
int idx = text.IndexOf('=');
|
||||
if (text.TrimStart().StartsWith("#"))
|
||||
return;
|
||||
|
||||
if (idx > 0)
|
||||
{
|
||||
ChangeLinePart(
|
||||
line.Offset,
|
||||
line.Offset + idx,
|
||||
el => el.TextRunProperties.SetForegroundBrush("#3F9CD6".ToBrush())
|
||||
);
|
||||
}
|
||||
}
|
||||
int idx = text.IndexOf('=');
|
||||
|
||||
if (idx <= 0)
|
||||
return;
|
||||
|
||||
ChangeLinePart(line.Offset, line.Offset + idx, el => el.TextRunProperties.SetForegroundBrush("#3F9CD6".ToBrush()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user