Skip to content

Commit 277f95e

Browse files
authored
start edits from cmd + up and arrows and enter (microsoft#253060)
navigated edits using enter
1 parent c8d6615 commit 277f95e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@ registerAction2(class RemoveAction extends Action2 {
340340
item = widget?.getFocus();
341341
}
342342

343-
344343
if (!item) {
345344
return;
346345
}
@@ -426,6 +425,11 @@ registerAction2(class EditAction extends Action2 {
426425
f1: false,
427426
category: CHAT_CATEGORY,
428427
icon: Codicon.edit,
428+
keybinding: {
429+
primary: KeyCode.Enter,
430+
when: ContextKeyExpr.and(ChatContextKeys.inChatSession, EditorContextKeys.textInputFocus.negate()),
431+
weight: KeybindingWeight.WorkbenchContrib,
432+
},
429433
menu: [
430434
{
431435
id: MenuId.ChatMessageTitle,
@@ -439,15 +443,16 @@ registerAction2(class EditAction extends Action2 {
439443

440444
async run(accessor: ServicesAccessor, ...args: any[]) {
441445
let item: ChatTreeItem | undefined = args[0];
442-
if (!item) {
443-
return;
444-
}
445446
const chatWidgetService = accessor.get(IChatWidgetService);
446447
const widget = chatWidgetService.lastFocusedWidget;
447448
if (!isResponseVM(item) && !isRequestVM(item)) {
448449
item = widget?.getFocus();
449450
}
450451

452+
if (!item) {
453+
return;
454+
}
455+
451456
if (isRequestVM(item)) {
452457
widget?.startEditing(item.id);
453458
}

0 commit comments

Comments
 (0)