Highlighter: Report each key type separately
This commit is contained in:
parent
728b3ef61f
commit
5802c74245
|
@ -56,10 +56,6 @@ class ConfTextStorage: NSTextStorage {
|
||||||
.foregroundColor: theme.key,
|
.foregroundColor: theme.key,
|
||||||
.font: boldFont
|
.font: boldFont
|
||||||
],
|
],
|
||||||
HighlightKey.rawValue: [
|
|
||||||
.foregroundColor: theme.plainText,
|
|
||||||
.font: defaultFont
|
|
||||||
],
|
|
||||||
HighlightIP.rawValue: [
|
HighlightIP.rawValue: [
|
||||||
.foregroundColor: theme.url,
|
.foregroundColor: theme.url,
|
||||||
.font: defaultFont
|
.font: defaultFont
|
||||||
|
|
|
@ -470,9 +470,13 @@ static void highlight_value(struct highlight_span_array *ret, const string_span_
|
||||||
{
|
{
|
||||||
switch (section) {
|
switch (section) {
|
||||||
case PrivateKey:
|
case PrivateKey:
|
||||||
|
append_highlight_span(ret, parent.s, s, is_valid_key(s) ? HighlightPrivateKey : HighlightError);
|
||||||
|
break;
|
||||||
case PublicKey:
|
case PublicKey:
|
||||||
|
append_highlight_span(ret, parent.s, s, is_valid_key(s) ? HighlightPublicKey : HighlightError);
|
||||||
|
break;
|
||||||
case PresharedKey:
|
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;
|
break;
|
||||||
case MTU:
|
case MTU:
|
||||||
append_highlight_span(ret, parent.s, s, is_valid_mtu(s) ? HighlightMTU : HighlightError);
|
append_highlight_span(ret, parent.s, s, is_valid_mtu(s) ? HighlightMTU : HighlightError);
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
enum highlight_type {
|
enum highlight_type {
|
||||||
HighlightSection,
|
HighlightSection,
|
||||||
HighlightKeytype,
|
HighlightKeytype,
|
||||||
HighlightKey,
|
HighlightPrivateKey,
|
||||||
|
HighlightPublicKey,
|
||||||
|
HighlightPresharedKey,
|
||||||
HighlightIP,
|
HighlightIP,
|
||||||
HighlightCidr,
|
HighlightCidr,
|
||||||
HighlightHost,
|
HighlightHost,
|
||||||
|
|
Loading…
Reference in New Issue