fix(tui): update CustomEditor ctor
This commit is contained in:
@@ -13,10 +13,9 @@ export class CustomEditor extends Editor {
|
||||
onAltEnter?: () => void;
|
||||
|
||||
constructor(tuiOrTheme: TUI | EditorTheme, themeMaybe?: EditorTheme) {
|
||||
const useTui = typeof themeMaybe !== "undefined" && Editor.length >= 2;
|
||||
const args = (useTui ? [tuiOrTheme, themeMaybe] : [tuiOrTheme]) as ConstructorParameters<
|
||||
typeof Editor
|
||||
>;
|
||||
const useLegacyCtor = typeof themeMaybe !== "undefined" && Editor.length >= 2;
|
||||
const args = (useLegacyCtor ? [tuiOrTheme, themeMaybe] : [themeMaybe ?? tuiOrTheme]) as
|
||||
ConstructorParameters<typeof Editor>;
|
||||
super(...args);
|
||||
}
|
||||
handleInput(data: string): void {
|
||||
|
||||
@@ -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(tui, editorTheme);
|
||||
const editor = new CustomEditor(editorTheme);
|
||||
const root = new Container();
|
||||
root.addChild(header);
|
||||
root.addChild(chatLog);
|
||||
|
||||
Reference in New Issue
Block a user