diff --git a/Core/Sources/SuggestionWidget/SuggestionWidgetController.swift b/Core/Sources/SuggestionWidget/SuggestionWidgetController.swift index 0d31399b..162ce8d4 100644 --- a/Core/Sources/SuggestionWidget/SuggestionWidgetController.swift +++ b/Core/Sources/SuggestionWidget/SuggestionWidgetController.swift @@ -172,10 +172,11 @@ public final class SuggestionWidgetController: NSObject { if app != previousApp { windowChangeObservationTask?.cancel() windowChangeObservationTask = nil - self.observeXcodeWindowChangeIfNeeded(app) + observeXcodeWindowChangeIfNeeded(app) } - await self.updateContentForActiveEditor() - self.updateWindowLocation() + await updateContentForActiveEditor() + updateWindowLocation() + orderFront() } else { if ActiveApplicationMonitor.activeApplication?.bundleIdentifier != Bundle .main.bundleIdentifier @@ -203,11 +204,8 @@ public final class SuggestionWidgetController: NSObject { guard let activeXcode = ActiveApplicationMonitor.activeXcode else { continue } guard fullscreenDetector.isOnActiveSpace else { continue } let app = AXUIElementCreateApplication(activeXcode.processIdentifier) - if let window = app.focusedWindow, window.isFullScreen { - widgetWindow.orderFrontRegardless() - tabWindow.orderFrontRegardless() - panelWindow.orderFrontRegardless() - chatWindow.orderFrontRegardless() + if let window = app.focusedWindow { + orderFront() } } } @@ -263,6 +261,13 @@ public final class SuggestionWidgetController: NSObject { } } } + + func orderFront() { + widgetWindow.orderFrontRegardless() + tabWindow.orderFrontRegardless() + panelWindow.orderFrontRegardless() + chatWindow.orderFrontRegardless() + } } // MARK: - Handle Events diff --git a/Core/Sources/SuggestionWidget/SyntaxHighlighting.swift b/Core/Sources/SuggestionWidget/SyntaxHighlighting.swift index 761546d7..ce856445 100644 --- a/Core/Sources/SuggestionWidget/SyntaxHighlighting.swift +++ b/Core/Sources/SuggestionWidget/SyntaxHighlighting.swift @@ -77,7 +77,8 @@ func highlightedCodeBlock( return formatted default: var language = language - if language == "objective-c" { + // Workaround: Highlightr uses a different identifier for Objective-C. + if language.lowercased().hasPrefix("objective"), language.lowercased().hasSuffix("c") { language = "objectivec" } func unhighlightedCode() -> NSAttributedString { diff --git a/Version.xcconfig b/Version.xcconfig index 10f85f0e..6542541d 100644 --- a/Version.xcconfig +++ b/Version.xcconfig @@ -1,2 +1,2 @@ -APP_VERSION = 0.16.0 -APP_BUILD = 160 +APP_VERSION = 0.16.1 +APP_BUILD = 161 diff --git a/appcast.xml b/appcast.xml index b8dcbd59..3feebf09 100644 --- a/appcast.xml +++ b/appcast.xml @@ -3,6 +3,18 @@ Copilot for Xcode + + 0.16.1 + Tue, 23 May 2023 11:06:14 +0800 + 161 + 0.16.1 + 12.0 + + https://github.com/intitni/CopilotForXcode/releases/tag/0.16.1 + + + + 0.16.0 Thu, 18 May 2023 18:42:47 +0800 @@ -14,7 +26,7 @@ - + 0.15.4 Mon, 15 May 2023 22:13:11 +0800