diff options
author | 2019-01-21 22:22:20 +0100 | |
---|---|---|
committer | 2019-01-21 22:22:20 +0100 | |
commit | e1198b6e085310105e8d37effe221a1363d91c41 (patch) | |
tree | 4a6c01acf79d9bc6df7dccae6928395d581eadfc /WireGuard/WireGuard/UI | |
parent | macOS: Make highlighter themes static (diff) | |
download | wireguard-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/WireGuard/UI')
-rw-r--r-- | WireGuard/WireGuard/UI/macOS/View/ConfTextStorage.swift | 2 | ||||
-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 |
3 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 fb8a382..688913c 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 171a84c..171a84c 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 885db2d..885db2d 100644 --- a/WireGuard/WireGuard/UI/macOS/highlighter.h +++ b/WireGuard/WireGuard/UI/macOS/View/highlighter.h |