diff --git a/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Themes/HighlightingDefinitions/Dark/PropertiesHighlightingDefinition.cs b/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Themes/HighlightingDefinitions/Dark/PropertiesHighlightingDefinition.cs index dd98e26..c5bafe1 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Themes/HighlightingDefinitions/Dark/PropertiesHighlightingDefinition.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Themes/HighlightingDefinitions/Dark/PropertiesHighlightingDefinition.cs @@ -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())); } } } diff --git a/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Themes/HighlightingDefinitions/Light/PropertiesHighlightingDefinition.cs b/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Themes/HighlightingDefinitions/Light/PropertiesHighlightingDefinition.cs index e5c2630..d98f951 100644 --- a/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Themes/HighlightingDefinitions/Light/PropertiesHighlightingDefinition.cs +++ b/QuickLook.Plugin/QuickLook.Plugin.TextViewer/Themes/HighlightingDefinitions/Light/PropertiesHighlightingDefinition.cs @@ -68,19 +68,15 @@ public class PropertiesHighlightingDefinition : LightHighlightingDefinition { 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(Colors.Blue.ToBrush()) - ); - } - } + int idx = text.IndexOf('='); + + if (idx <= 0) + return; + + ChangeLinePart(line.Offset, line.Offset + idx, el => el.TextRunProperties.SetForegroundBrush(Colors.Blue.ToBrush())); } } }