From 00bd8b5572b2d4db9e157532d130759b671e493c Mon Sep 17 00:00:00 2001 From: Adrian Schoenig Date: Sat, 29 Apr 2023 19:23:30 +1000 Subject: [PATCH] Re-instate line that shouldn't have been deleted, and maintain correct QOS --- Sources/RunestoneSwiftUI/TextEditor.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/RunestoneSwiftUI/TextEditor.swift b/Sources/RunestoneSwiftUI/TextEditor.swift index 90cf2813c..47162de7b 100644 --- a/Sources/RunestoneSwiftUI/TextEditor.swift +++ b/Sources/RunestoneSwiftUI/TextEditor.swift @@ -86,7 +86,9 @@ public class TextEditorCoordinator: ObservableObject { func configure(text: Binding, theme: Theme, language: TreeSitterLanguage?, completion: @escaping (TextViewState) -> Void) { guard self.text?.wrappedValue != text.wrappedValue else { return } - DispatchQueue.global(qos: .background).async { + self.text = text + + DispatchQueue.global(qos: .userInteractive).async { let state: TextViewState if let language = language { state = TextViewState(text: text.wrappedValue, theme: theme, language: language)