Skip to content

Commit b21f65c

Browse files
committed
Add copy button to prompt to code
1 parent 4987cd3 commit b21f65c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Core/Sources/SuggestionWidget/SuggestionPanelContent/PromptToCodePanel.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ struct PromptToCodePanel: View {
5252
Spacer(minLength: 50)
5353
}
5454
}
55+
.overlay(alignment: .topTrailing) {
56+
if !provider.code.isEmpty {
57+
CopyButton {
58+
NSPasteboard.general.clearContents()
59+
NSPasteboard.general.setString(provider.code, forType: .string)
60+
}
61+
.padding(.trailing, 2)
62+
.padding(.top, 2)
63+
}
64+
}
5565
.overlay(alignment: .bottom) {
5666
Group {
5767
if provider.isResponding {

0 commit comments

Comments
 (0)