|
|
@@ -44,6 +44,7 @@ export type PromptRef = {
|
|
|
reset(): void
|
|
|
blur(): void
|
|
|
focus(): void
|
|
|
+ submit(): void
|
|
|
}
|
|
|
|
|
|
const PLACEHOLDERS = ["Fix a TODO in the codebase", "What is the tech stack of this project?", "Fix broken tests"]
|
|
|
@@ -447,11 +448,14 @@ export function Prompt(props: PromptProps) {
|
|
|
})
|
|
|
setStore("extmarkToPartIndex", new Map())
|
|
|
},
|
|
|
+ submit() {
|
|
|
+ submit()
|
|
|
+ },
|
|
|
})
|
|
|
|
|
|
async function submit() {
|
|
|
if (props.disabled) return
|
|
|
- if (autocomplete.visible) return
|
|
|
+ if (autocomplete?.visible) return
|
|
|
if (!store.prompt.input) return
|
|
|
const trimmed = store.prompt.input.trim()
|
|
|
if (trimmed === "exit" || trimmed === "quit" || trimmed === ":q") {
|