fix(tui): bind ctrl+j as newline by default
This commit is contained in:
@@ -3,6 +3,14 @@ import { describe, it } from "node:test";
|
||||
import { KeybindingsManager, TUI_KEYBINDINGS } from "../src/keybindings.ts";
|
||||
|
||||
describe("KeybindingsManager", () => {
|
||||
it("binds Ctrl+J as a default newline alias", () => {
|
||||
const keybindings = new KeybindingsManager(TUI_KEYBINDINGS);
|
||||
|
||||
assert.deepStrictEqual(keybindings.getKeys("tui.input.newLine"), ["shift+enter", "ctrl+j"]);
|
||||
assert.strictEqual(keybindings.matches("\n", "tui.input.newLine"), true);
|
||||
assert.strictEqual(keybindings.matches("\x1b[106;5u", "tui.input.newLine"), true);
|
||||
});
|
||||
|
||||
it("does not evict selector confirm when input submit is rebound", () => {
|
||||
const keybindings = new KeybindingsManager(TUI_KEYBINDINGS, {
|
||||
"tui.input.submit": ["enter", "ctrl+enter"],
|
||||
|
||||
Reference in New Issue
Block a user