fix: config form semantics + editor ctor (#1315) (thanks @MaudeBot)

This commit is contained in:
Peter Steinberger
2026-01-20 20:12:16 +00:00
parent c287664923
commit 2e7e135bc0
6 changed files with 76 additions and 39 deletions

View File

@@ -1,4 +1,4 @@
import { Editor, type EditorTheme, Key, matchesKey } from "@mariozechner/pi-tui";
import { Editor, type EditorTheme, Key, matchesKey, type TUI } from "@mariozechner/pi-tui";
export class CustomEditor extends Editor {
onEscape?: () => void;
@@ -12,8 +12,8 @@ export class CustomEditor extends Editor {
onShiftTab?: () => void;
onAltEnter?: () => void;
constructor(theme: EditorTheme) {
super(theme);
constructor(tui: TUI, theme: EditorTheme) {
super(tui, theme);
}
handleInput(data: string): void {
if (matchesKey(data, Key.alt("enter")) && this.onAltEnter) {

View File

@@ -193,7 +193,7 @@ export async function runTui(opts: TuiOptions) {
const statusContainer = new Container();
const footer = new Text("", 1, 0);
const chatLog = new ChatLog();
const editor = new CustomEditor(editorTheme);
const editor = new CustomEditor(tui, editorTheme);
const root = new Container();
root.addChild(header);
root.addChild(chatLog);