aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-09 00:41:36 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-14 14:52:35 +0530
commit80977b95dec7224519c0a9b775f4fe4a203f6966 (patch)
treee4c848d6b5e49213263ada66fb727f3d6c7eb5ad /WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
parentHighlighter: Report each key type separately (diff)
downloadwireguard-apple-80977b95dec7224519c0a9b775f4fe4a203f6966.tar.xz
wireguard-apple-80977b95dec7224519c0a9b775f4fe4a203f6966.zip
macOS: Edit view: Update public key as you edit
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift4
1 files changed, 4 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift b/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
index cd91b01..eda5ee9 100644
--- a/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
+++ b/WireGuard/WireGuard/UI/macOS/View/ConfTextView.swift
@@ -8,6 +8,7 @@ class ConfTextView: NSTextView {
private let confTextStorage = ConfTextStorage()
var hasError: Bool { return confTextStorage.hasError }
+ @objc dynamic var privateKeyString: String?
override var string: String {
didSet {
@@ -51,6 +52,9 @@ extension ConfTextView: NSTextViewDelegate {
func textDidChange(_ notification: Notification) {
confTextStorage.highlightSyntax()
+ if privateKeyString != confTextStorage.privateKeyString {
+ privateKeyString = confTextStorage.privateKeyString
+ }
needsDisplay = true
}