From 4c3e93672636f22f2970593ae652642cb2846421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Do=CC=88rr?= Date: Thu, 4 Jun 2026 07:54:54 +0200 Subject: [PATCH] Update view when value in text binding changes --- .../CodeEditSourceEditor/SourceEditor/SourceEditor.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Sources/CodeEditSourceEditor/SourceEditor/SourceEditor.swift b/Sources/CodeEditSourceEditor/SourceEditor/SourceEditor.swift index ed3ee508b..d274c77f9 100644 --- a/Sources/CodeEditSourceEditor/SourceEditor/SourceEditor.swift +++ b/Sources/CodeEditSourceEditor/SourceEditor/SourceEditor.swift @@ -140,6 +140,14 @@ public struct SourceEditor: NSViewControllerRepresentable { } else { context.coordinator.isUpdatingFromRepresentable = true updateControllerWithState(state, controller: controller) + switch text { + case .storage: + break + case let .binding(text): + if controller.text != text.wrappedValue { + controller.text = text.wrappedValue + } + } context.coordinator.isUpdatingFromRepresentable = false }