From 03ac74486c5076ea45f4c5d2c6e5611649715db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Thu, 21 Apr 2022 12:25:56 +0200 Subject: [PATCH] Disallow color changes Fixes issue #12 We just override -changeColor: to do nothing. Though this feels a little like a SwiftUI issue. --- Sources/CodeEditor/UXCodeTextView.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/CodeEditor/UXCodeTextView.swift b/Sources/CodeEditor/UXCodeTextView.swift index 3e096f4..a352e10 100644 --- a/Sources/CodeEditor/UXCodeTextView.swift +++ b/Sources/CodeEditor/UXCodeTextView.swift @@ -99,6 +99,11 @@ final class UXCodeTextView: UXTextView { // MARK: - Actions #if os(macOS) + override func changeColor(_ sender: Any?) { + // https://github.com/ZeeZide/CodeEditor/issues/12 + // Reject user based color changes. + } + override func changeFont(_ sender: Any?) { let coordinator = delegate as? UXCodeTextViewDelegate