Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions Core/Sources/SuggestionWidget/SuggestionWidgetController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
}
}
Expand Down Expand Up @@ -263,6 +261,13 @@ public final class SuggestionWidgetController: NSObject {
}
}
}

func orderFront() {
widgetWindow.orderFrontRegardless()
tabWindow.orderFrontRegardless()
panelWindow.orderFrontRegardless()
chatWindow.orderFrontRegardless()
}
}

// MARK: - Handle Events
Expand Down
3 changes: 2 additions & 1 deletion Core/Sources/SuggestionWidget/SyntaxHighlighting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions Version.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
APP_VERSION = 0.16.0
APP_BUILD = 160
APP_VERSION = 0.16.1
APP_BUILD = 161
14 changes: 13 additions & 1 deletion appcast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
<channel>
<title>Copilot for Xcode</title>

<item>
<title>0.16.1</title>
<pubDate>Tue, 23 May 2023 11:06:14 +0800</pubDate>
<sparkle:version>161</sparkle:version>
<sparkle:shortVersionString>0.16.1</sparkle:shortVersionString>
<sparkle:minimumSystemVersion>12.0</sparkle:minimumSystemVersion>
<sparkle:releaseNotesLink>
https://github.com/intitni/CopilotForXcode/releases/tag/0.16.1
</sparkle:releaseNotesLink>
<enclosure url="https://github.com/intitni/CopilotForXcode/releases/download/0.16.1/Copilot.for.Xcode.app.zip" length="21012368" type="application/octet-stream" sparkle:edSignature="Z4Krbh53X0frA0WhhGHh2QXEKUJQz65SXQKFyn6rJmk7eXdbF0HhllEchUUooeQMeeIkR8I2VhK5Uq7Qenh1Dw=="/>
</item>

<item>
<title>0.16.0</title>
<pubDate>Thu, 18 May 2023 18:42:47 +0800</pubDate>
Expand All @@ -14,7 +26,7 @@
</sparkle:releaseNotesLink>
<enclosure url="https://github.com/intitni/CopilotForXcode/releases/download/0.16.0/Copilot.for.Xcode.app.zip" length="21012542" type="application/octet-stream" sparkle:edSignature="K/lsLbYeNCJrE71a9xaUOf3lD5SyFqrkgMlTUd7xJinMnx4fWkP9WtzPFCq9n/A2H6X1awFtDhov6mEkMhx7Bg=="/>
</item>

<item>
<title>0.15.4</title>
<pubDate>Mon, 15 May 2023 22:13:11 +0800</pubDate>
Expand Down