Make 'enter' a no-op while chat loads instead of sending it to the editor (#237453)
Fix microsoft/vscode-copilot#10718pull/164479/merge
parent
ade73d22b7
commit
cee4706830
|
@ -52,7 +52,7 @@ export class ChatSubmitAction extends SubmitAction {
|
|||
f1: false,
|
||||
category: CHAT_CATEGORY,
|
||||
icon: Codicon.send,
|
||||
precondition: ContextKeyExpr.and(ChatContextKeys.inputHasText, ChatContextKeys.requestInProgress.negate(), ChatContextKeys.location.notEqualsTo(ChatAgentLocation.EditingSession)),
|
||||
precondition: ContextKeyExpr.and(ChatContextKeys.inputHasText, ChatContextKeys.location.notEqualsTo(ChatAgentLocation.EditingSession)),
|
||||
keybinding: {
|
||||
when: ChatContextKeys.inChatInput,
|
||||
primary: KeyCode.Enter,
|
||||
|
@ -131,7 +131,7 @@ export class ChatEditingSessionSubmitAction extends SubmitAction {
|
|||
f1: false,
|
||||
category: CHAT_CATEGORY,
|
||||
icon: Codicon.send,
|
||||
precondition: ContextKeyExpr.and(ChatContextKeys.inputHasText, ChatContextKeys.requestInProgress.negate(), ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession), applyingChatEditsContextKey.toNegated()),
|
||||
precondition: ContextKeyExpr.and(ChatContextKeys.inputHasText, ChatContextKeys.location.isEqualTo(ChatAgentLocation.EditingSession), applyingChatEditsContextKey.toNegated()),
|
||||
keybinding: {
|
||||
when: ChatContextKeys.inChatInput,
|
||||
primary: KeyCode.Enter,
|
||||
|
|
|
@ -985,6 +985,10 @@ export class ChatWidget extends Disposable implements IChatWidget {
|
|||
}
|
||||
|
||||
private async _acceptInput(query: { query: string } | { prefix: string } | undefined, options?: IChatAcceptInputOptions): Promise<IChatResponseModel | undefined> {
|
||||
if (this.viewModel?.requestInProgress) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.viewModel) {
|
||||
this._onDidAcceptInput.fire();
|
||||
if (!this.viewOptions.autoScroll) {
|
||||
|
|
Loading…
Reference in New Issue