diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift index 63c9cbf..2a9d36d 100644 --- a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift +++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift @@ -56,10 +56,6 @@ class ConfTextStorage: NSTextStorage { .foregroundColor: theme.key, .font: boldFont ], - HighlightKey.rawValue: [ - .foregroundColor: theme.plainText, - .font: defaultFont - ], HighlightIP.rawValue: [ .foregroundColor: theme.url, .font: defaultFont diff --git a/WireGuard/WireGuard/UI/macOS/highlighter.c b/WireGuard/WireGuard/UI/macOS/highlighter.c index cc4a74a..ff8bf06 100644 --- a/WireGuard/WireGuard/UI/macOS/highlighter.c +++ b/WireGuard/WireGuard/UI/macOS/highlighter.c @@ -470,9 +470,13 @@ static void highlight_value(struct highlight_span_array *ret, const string_span_ { switch (section) { case PrivateKey: + append_highlight_span(ret, parent.s, s, is_valid_key(s) ? HighlightPrivateKey : HighlightError); + break; case PublicKey: + append_highlight_span(ret, parent.s, s, is_valid_key(s) ? HighlightPublicKey : HighlightError); + break; case PresharedKey: - append_highlight_span(ret, parent.s, s, is_valid_key(s) ? HighlightKey : HighlightError); + append_highlight_span(ret, parent.s, s, is_valid_key(s) ? HighlightPresharedKey : HighlightError); break; case MTU: append_highlight_span(ret, parent.s, s, is_valid_mtu(s) ? HighlightMTU : HighlightError); diff --git a/WireGuard/WireGuard/UI/macOS/highlighter.h b/WireGuard/WireGuard/UI/macOS/highlighter.h index d88638b..4e5fa4c 100644 --- a/WireGuard/WireGuard/UI/macOS/highlighter.h +++ b/WireGuard/WireGuard/UI/macOS/highlighter.h @@ -8,7 +8,9 @@ enum highlight_type { HighlightSection, HighlightKeytype, - HighlightKey, + HighlightPrivateKey, + HighlightPublicKey, + HighlightPresharedKey, HighlightIP, HighlightCidr, HighlightHost,