Skip to content

Commit 0d38175

Browse files
authored
Focus textbox and add newlines after adding to context (#8877)
1 parent 49fde41 commit 0d38175

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,12 @@ export class ClineProvider
677677
const prompt = supportPrompt.create(promptType, params, customSupportPrompts)
678678

679679
if (command === "addToContext") {
680-
await visibleProvider.postMessageToWebview({ type: "invoke", invoke: "setChatBoxMessage", text: prompt })
680+
await visibleProvider.postMessageToWebview({
681+
type: "invoke",
682+
invoke: "setChatBoxMessage",
683+
text: `${prompt}\n\n`,
684+
})
685+
await visibleProvider.postMessageToWebview({ type: "action", action: "focusInput" })
681686
return
682687
}
683688

@@ -701,7 +706,12 @@ export class ClineProvider
701706
const prompt = supportPrompt.create(promptType, params, customSupportPrompts)
702707

703708
if (command === "terminalAddToContext") {
704-
await visibleProvider.postMessageToWebview({ type: "invoke", invoke: "setChatBoxMessage", text: prompt })
709+
await visibleProvider.postMessageToWebview({
710+
type: "invoke",
711+
invoke: "setChatBoxMessage",
712+
text: `${prompt}\n\n`,
713+
})
714+
await visibleProvider.postMessageToWebview({ type: "action", action: "focusInput" })
705715
return
706716
}
707717

0 commit comments

Comments
 (0)