Skip to content

Commit 7703e1f

Browse files
committed
Fix that previous/next suggestion will dismiss the suggestion panel
1 parent b1a216b commit 7703e1f

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

Core/Sources/SuggestionWidget/SuggestionPanelContent/CodeBlockSuggestionPanel.swift

+4-16
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,15 @@ struct CodeBlockSuggestionPanel: View {
7474
.monospacedDigit()
7575

7676
Button(action: {
77-
Task {
78-
await commandHandler.presentNextSuggestion()
79-
NSWorkspace.activatePreviousActiveXcode()
80-
}
77+
Task { await commandHandler.presentNextSuggestion() }
8178
}) {
8279
Image(systemName: "chevron.right")
8380
}.buttonStyle(.plain)
8481

8582
Spacer()
8683

8784
Button(action: {
88-
Task {
89-
await commandHandler.dismissSuggestion()
90-
NSWorkspace.activatePreviousActiveXcode()
91-
}
85+
Task { await commandHandler.dismissSuggestion() }
9286
}) {
9387
Text("Dismiss").foregroundStyle(.tertiary).padding(.trailing, 4)
9488
}.buttonStyle(.plain)
@@ -126,10 +120,7 @@ struct CodeBlockSuggestionPanel: View {
126120
WithPerceptionTracking {
127121
HStack {
128122
Button(action: {
129-
Task {
130-
await commandHandler.presentPreviousSuggestion()
131-
NSWorkspace.activatePreviousActiveXcode()
132-
}
123+
Task { await commandHandler.presentPreviousSuggestion() }
133124
}) {
134125
Image(systemName: "chevron.left")
135126
}.buttonStyle(.plain)
@@ -140,10 +131,7 @@ struct CodeBlockSuggestionPanel: View {
140131
.monospacedDigit()
141132

142133
Button(action: {
143-
Task {
144-
await commandHandler.presentNextSuggestion()
145-
NSWorkspace.activatePreviousActiveXcode()
146-
}
134+
Task { await commandHandler.presentNextSuggestion() }
147135
}) {
148136
Image(systemName: "chevron.right")
149137
}.buttonStyle(.plain)

0 commit comments

Comments
 (0)