mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-16 13:22:40 +00:00
Skip primary for comment lines in properties files
This commit is contained in:
@@ -66,14 +66,19 @@ public class PropertiesHighlightingDefinition : DarkHighlightingDefinition
|
|||||||
protected override void ColorizeLine(DocumentLine line)
|
protected override void ColorizeLine(DocumentLine line)
|
||||||
{
|
{
|
||||||
var text = CurrentContext.Document.GetText(line);
|
var text = CurrentContext.Document.GetText(line);
|
||||||
int idx = text.IndexOf('=');
|
|
||||||
if (idx > 0)
|
if (!text.TrimStart().StartsWith("#"))
|
||||||
{
|
{
|
||||||
ChangeLinePart(
|
int idx = text.IndexOf('=');
|
||||||
line.Offset,
|
|
||||||
line.Offset + idx,
|
if (idx > 0)
|
||||||
|
{
|
||||||
|
ChangeLinePart(
|
||||||
|
line.Offset,
|
||||||
|
line.Offset + idx,
|
||||||
el => el.TextRunProperties.SetForegroundBrush("#3F9CD6".ToBrush())
|
el => el.TextRunProperties.SetForegroundBrush("#3F9CD6".ToBrush())
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -67,14 +67,19 @@ public class PropertiesHighlightingDefinition : LightHighlightingDefinition
|
|||||||
protected override void ColorizeLine(DocumentLine line)
|
protected override void ColorizeLine(DocumentLine line)
|
||||||
{
|
{
|
||||||
var text = CurrentContext.Document.GetText(line);
|
var text = CurrentContext.Document.GetText(line);
|
||||||
int idx = text.IndexOf('=');
|
|
||||||
if (idx > 0)
|
if (!text.TrimStart().StartsWith("#"))
|
||||||
{
|
{
|
||||||
ChangeLinePart(
|
int idx = text.IndexOf('=');
|
||||||
line.Offset,
|
|
||||||
line.Offset + idx,
|
if (idx > 0)
|
||||||
el => el.TextRunProperties.SetForegroundBrush(Colors.Blue.ToBrush())
|
{
|
||||||
);
|
ChangeLinePart(
|
||||||
|
line.Offset,
|
||||||
|
line.Offset + idx,
|
||||||
|
el => el.TextRunProperties.SetForegroundBrush(Colors.Blue.ToBrush())
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user