docs(coding-agent): fix obsolete extension UI examples closes #6735

This commit is contained in:
Mario Zechner
2026-07-17 09:35:48 +02:00
parent e5e8726836
commit 58575888f5
4 changed files with 49 additions and 30 deletions
+3 -3
View File
@@ -2708,8 +2708,8 @@ class VimEditor extends CustomEditor {
export default function (pi: ExtensionAPI) {
pi.on("session_start", (_event, ctx) => {
ctx.ui.setEditorComponent((_tui, theme, keybindings) =>
new VimEditor(theme, keybindings)
ctx.ui.setEditorComponent((tui, theme, keybindings) =>
new VimEditor(tui, theme, keybindings)
);
});
}
@@ -2718,7 +2718,7 @@ export default function (pi: ExtensionAPI) {
**Key points:**
- Extend `CustomEditor` (not base `Editor`) to get app keybindings (escape to abort, ctrl+d, model switching)
- Call `super.handleInput(data)` for keys you don't handle
- Factory receives `theme` and `keybindings` from the app
- Factory receives `tui`, `theme`, and `keybindings` from the app
- Use `ctx.ui.getEditorComponent()` before `setEditorComponent()` to wrap the previously configured custom editor
- Pass `undefined` to restore default: `ctx.ui.setEditorComponent(undefined)`