From 5406bc54afd550b5e7260b31ac84c54dd33d87b8 Mon Sep 17 00:00:00 2001 From: George Harker Date: Thu, 26 Sep 2024 12:53:19 -0700 Subject: [PATCH] fix race on lcd / cwd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit must be done in main thread for access to NSTextView’s string rep --- NvimView/Sources/NvimView/NvimView+UiBridge.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NvimView/Sources/NvimView/NvimView+UiBridge.swift b/NvimView/Sources/NvimView/NvimView+UiBridge.swift index 4c4819fa..e1f3fd10 100644 --- a/NvimView/Sources/NvimView/NvimView+UiBridge.swift +++ b/NvimView/Sources/NvimView/NvimView+UiBridge.swift @@ -508,7 +508,9 @@ extension NvimView { self.bridgeLogger.debug(cwd) self._cwd = URL(fileURLWithPath: cwd) - self.tabBar?.cwd = cwd + gui.async { [self] in + self.tabBar?.cwd = cwd + } self.eventsSubject.onNext(.cwdChanged) }