mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 20:03:05 +00:00
fix(coding-agent): delegate extension shortcuts instead of copying (#947)
Extension shortcuts registered via registerShortcut() were not firing when the extension also used setEditorComponent(). This happened because setEditorComponent() copied onExtensionShortcut from defaultEditor at creation time, capturing undefined if setupExtensionShortcuts() hadn't run yet. The fix is to delegate to defaultEditor.onExtensionShortcut at call time.
This commit is contained in:
parent
62209c4a0f
commit
f1b1d54955
1 changed files with 1 additions and 1 deletions
|
|
@ -1575,7 +1575,7 @@ export class InteractiveMode {
|
|||
customEditor.onEscape = this.defaultEditor.onEscape;
|
||||
customEditor.onCtrlD = this.defaultEditor.onCtrlD;
|
||||
customEditor.onPasteImage = this.defaultEditor.onPasteImage;
|
||||
customEditor.onExtensionShortcut = this.defaultEditor.onExtensionShortcut;
|
||||
customEditor.onExtensionShortcut = (data: string) => this.defaultEditor.onExtensionShortcut?.(data);
|
||||
// Copy action handlers (clear, suspend, model switching, etc.)
|
||||
for (const [action, handler] of this.defaultEditor.actionHandlers) {
|
||||
(customEditor.actionHandlers as Map<string, () => void>).set(action, handler);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue