Skip to content

Commit 1421c52

Browse files
committed
Fix option+command+enter not working
1 parent dbdd9b0 commit 1421c52

1 file changed

Lines changed: 6 additions & 23 deletions

File tree

Core/Sources/SuggestionWidget/SuggestionPanelContent/PromptToCodePanelView.swift

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -304,28 +304,11 @@ extension PromptToCodePanelView {
304304
.padding(.trailing, 4)
305305
}
306306
.buttonStyle(TheButtonStyle())
307-
.keyboardShortcut(KeyEquivalent.return, modifiers: [.command])
308-
.background {
309-
Button(action: {
310-
switch (
311-
modifierFlags.contains(.option),
312-
defaultModeIsContinuous
313-
) {
314-
case (true, true):
315-
store.send(.acceptAndContinueButtonTapped)
316-
case (false, true):
317-
store.send(.acceptButtonTapped)
318-
case (true, false):
319-
store.send(.acceptButtonTapped)
320-
case (false, false):
321-
store.send(.acceptAndContinueButtonTapped)
322-
}
323-
}) {
324-
EmptyView()
325-
}
326-
.buttonStyle(.plain)
327-
.keyboardShortcut(KeyEquivalent.return, modifiers: [.command, .option])
328-
}
307+
.keyboardShortcut(
308+
KeyEquivalent.return,
309+
modifiers: modifierFlags
310+
.contains(.option) ? [.command, .option] : [.command]
311+
)
329312

330313
Divider()
331314

@@ -465,7 +448,7 @@ extension PromptToCodePanelView {
465448
DescriptionContent(store: store, codeForegroundColor: codeForegroundColor)
466449
CodeContent(
467450
store: store,
468-
language: language,
451+
language: language,
469452
isGenerating: isGenerating,
470453
codeForegroundColor: codeForegroundColor
471454
)

0 commit comments

Comments
 (0)