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:
committed by
GitHub
parent
bac57f81be
commit
d57a26c88b
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user