mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 00:04:50 +00:00
fix(tui): remove backslash input buffering (#1037)
Instead of buffering `\` and waiting for the next key, let it be inserted immediately. On Enter, check if preceded by `\` and treat as newline. Removed backslash handling from the Input component entirely.
This commit is contained in:
parent
bac57f81be
commit
d57a26c88b
4 changed files with 61 additions and 43 deletions
|
|
@ -19,7 +19,6 @@ export class Input implements Component, Focusable {
|
|||
// Bracketed paste mode buffering
|
||||
private pasteBuffer: string = "";
|
||||
private isInPaste: boolean = false;
|
||||
private pendingShiftEnter: boolean = false;
|
||||
|
||||
getValue(): string {
|
||||
return this.value;
|
||||
|
|
@ -68,22 +67,6 @@ export class Input implements Component, Focusable {
|
|||
return;
|
||||
}
|
||||
|
||||
if (this.pendingShiftEnter) {
|
||||
if (data === "\r") {
|
||||
this.pendingShiftEnter = false;
|
||||
if (this.onSubmit) this.onSubmit(this.value);
|
||||
return;
|
||||
}
|
||||
this.pendingShiftEnter = false;
|
||||
this.value = `${this.value.slice(0, this.cursor)}\\${this.value.slice(this.cursor)}`;
|
||||
this.cursor += 1;
|
||||
}
|
||||
|
||||
if (data === "\\") {
|
||||
this.pendingShiftEnter = true;
|
||||
return;
|
||||
}
|
||||
|
||||
const kb = getEditorKeybindings();
|
||||
|
||||
// Escape/Cancel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue