aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-01-21 22:22:20 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-01-21 22:22:20 +0100
commite1198b6e085310105e8d37effe221a1363d91c41 (patch)
tree4a6c01acf79d9bc6df7dccae6928395d581eadfc /WireGuard
parentmacOS: Make highlighter themes static (diff)
downloadwireguard-apple-e1198b6e085310105e8d37effe221a1363d91c41.tar.xz
wireguard-apple-e1198b6e085310105e8d37effe221a1363d91c41.zip
macOS: Better highlighter default value and move c implementation
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard')
-rw-r--r--WireGuard/WireGuard.xcodeproj/project.pbxproj4
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift2
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/highlighter.c (renamed from WireGuard/WireGuard/UI/macOS/highlighter.c)0
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/highlighter.h (renamed from WireGuard/WireGuard/UI/macOS/highlighter.h)0
4 files changed, 3 insertions, 3 deletions
diff --git a/WireGuard/WireGuard.xcodeproj/project.pbxproj b/WireGuard/WireGuard.xcodeproj/project.pbxproj
index c63c721d..943f5a90 100644
--- a/WireGuard/WireGuard.xcodeproj/project.pbxproj
+++ b/WireGuard/WireGuard.xcodeproj/project.pbxproj
@@ -391,6 +391,8 @@
6F4DD16921DA556600690EAE /* View */ = {
isa = PBXGroup;
children = (
+ 5F52D0C021E378C000283CEA /* highlighter.h */,
+ 5F52D0C121E378C000283CEA /* highlighter.c */,
6F4DD16A21DA558800690EAE /* TunnelListRow.swift */,
6F613D9A21DE33B8004B217A /* KeyValueRow.swift */,
5F52D0BA21E3781B00283CEA /* ConfTextView.swift */,
@@ -529,8 +531,6 @@
6FB1BD6721D2607E00A991BF /* WireGuard.entitlements */,
6F4DD16721DA552B00690EAE /* NSTableView+Reuse.swift */,
5F52D0BE21E3788900283CEA /* NSColor+Hex.swift */,
- 5F52D0C021E378C000283CEA /* highlighter.h */,
- 5F52D0C121E378C000283CEA /* highlighter.c */,
6FFACD1E21E4D89600E9A2A5 /* ParseError+WireGuardAppError.swift */,
);
path = macOS;
diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
index fb8a382e..688913c2 100644
--- a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
+++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
@@ -101,7 +101,7 @@ class ConfTextStorage: NSTextStorage {
let range = NSRange(location: span.start, length: span.len)
backingStore.setAttributes(nonColorAttributes(for: span.type), range: range)
- let color = textColorTheme.colorMap[span.type.rawValue] ?? textColorTheme.defaultColor
+ let color = textColorTheme.colorMap[span.type.rawValue, default: textColorTheme.defaultColor]
backingStore.addAttribute(.foregroundColor, value: color, range: range)
if span.type == HighlightError {
diff --git a/WireGuard/WireGuard/UI/macOS/highlighter.c b/WireGuard/WireGuard/UI/macOS/View/highlighter.c
index 171a84c9..171a84c9 100644
--- a/WireGuard/WireGuard/UI/macOS/highlighter.c
+++ b/WireGuard/WireGuard/UI/macOS/View/highlighter.c
diff --git a/WireGuard/WireGuard/UI/macOS/highlighter.h b/WireGuard/WireGuard/UI/macOS/View/highlighter.h
index 885db2de..885db2de 100644
--- a/WireGuard/WireGuard/UI/macOS/highlighter.h
+++ b/WireGuard/WireGuard/UI/macOS/View/highlighter.h