Forráskód Böngészése

Hit enter to add auto-approved commands

Matt Rubens 1 éve
szülő
commit
afc22f0d6e
1 módosított fájl, 6 hozzáadás és 0 törlés
  1. 6 0
      webview-ui/src/components/settings/SettingsView.tsx

+ 6 - 0
webview-ui/src/components/settings/SettingsView.tsx

@@ -245,6 +245,12 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {
 									<VSCodeTextField
 										value={commandInput}
 										onInput={(e: any) => setCommandInput(e.target.value)}
+										onKeyDown={(e: any) => {
+											if (e.key === 'Enter') {
+												e.preventDefault()
+												handleAddCommand()
+											}
+										}}
 										placeholder="Enter command prefix (e.g., 'git ')"
 										style={{ flexGrow: 1 }}
 									/>