Skip primary for comment lines in properties files
Some checks are pending
MSBuild / build (push) Waiting to run
MSBuild / publish (push) Blocked by required conditions

This commit is contained in:
ema
2025-06-27 22:49:28 +08:00
parent 12046220c1
commit e113030dce
2 changed files with 23 additions and 13 deletions

View File

@@ -66,7 +66,11 @@ 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);
if (!text.TrimStart().StartsWith("#"))
{
int idx = text.IndexOf('='); int idx = text.IndexOf('=');
if (idx > 0) if (idx > 0)
{ {
ChangeLinePart( ChangeLinePart(
@@ -77,4 +81,5 @@ public class PropertiesHighlightingDefinition : DarkHighlightingDefinition
} }
} }
} }
}
} }

View File

@@ -67,7 +67,11 @@ 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);
if (!text.TrimStart().StartsWith("#"))
{
int idx = text.IndexOf('='); int idx = text.IndexOf('=');
if (idx > 0) if (idx > 0)
{ {
ChangeLinePart( ChangeLinePart(
@@ -78,4 +82,5 @@ public class PropertiesHighlightingDefinition : LightHighlightingDefinition
} }
} }
} }
}
} }