aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-22 01:58:58 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-22 02:01:32 +0530
commite0798b8a971f0b2d69c6cb0778d438d08a6aa171 (patch)
tree14e1fb98cc4f13e26e6a99e66803d9229afc054e /WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
parentmacOS: Reset attributes for each syntax highlight cycle (diff)
downloadwireguard-apple-e0798b8a971f0b2d69c6cb0778d438d08a6aa171.tar.xz
wireguard-apple-e0798b8a971f0b2d69c6cb0778d438d08a6aa171.zip
macOS: Make color theme use a dict
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift2
1 files changed, 1 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
index 511a35cf..423e7cd2 100644
--- a/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
+++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift
@@ -103,7 +103,7 @@ class ConfTextStorage: NSTextStorage {
let range = NSRange(location: span.start, length: span.len)
backingStore.setAttributes(nonColorAttributes(for: span.type), range: range)
if let textColorTheme = textColorTheme {
- let color = textColorTheme.color(for: span.type)
+ let color = textColorTheme.colorMap[span.type.rawValue] ?? textColorTheme.defaultColor
backingStore.addAttribute(.foregroundColor, value: color, range: range)
}