From a72323bfbc53b4ed805892c1b799aa4b4751434b Mon Sep 17 00:00:00 2001 From: Chris Hocking Date: Tue, 28 Feb 2023 11:48:00 +1100 Subject: [PATCH] Adjusted how we add text to the Console - Closes #3389 --- Hammerspoon/MJConsoleWindowController.m | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Hammerspoon/MJConsoleWindowController.m b/Hammerspoon/MJConsoleWindowController.m index b505eda24..be314ff57 100644 --- a/Hammerspoon/MJConsoleWindowController.m +++ b/Hammerspoon/MJConsoleWindowController.m @@ -139,9 +139,11 @@ - (void) appendString:(NSString*)str type:(MJReplLineType)type { NSDictionary* attrs = @{NSFontAttributeName: self.consoleFont, NSForegroundColorAttributeName: color}; NSAttributedString* attrstr = [[NSAttributedString alloc] initWithString:str attributes:attrs]; - [[self.outputView textStorage] performSelectorOnMainThread:@selector(appendAttributedString:) - withObject:attrstr - waitUntilDone:YES]; + + [self.outputView.textStorage beginEditing]; + [self.outputView.textStorage appendAttributedString:attrstr]; + [self.outputView.textStorage endEditing]; + [self.outputView didChangeText]; } - (NSString*) run:(NSString*)command {