Text fields keep ctrl+u and ctrl+d for editing
This commit is contained in:
1 parent
49fc25f7a2
commit
e857146c9a
2 files changed
+10
-2
No files matched your search
+2
-2
@@ -700,8 +700,8 @@ export function App(props: { readonly session: T3Session; readonly config: Tui3C
|
|||||||
const editorKey: Binding | null = hasComposer ? { keys: ["ctrl+g"], run: openEditor, command: { id: "editor", title: "Write the message in $EDITOR", keywords: ["vim", "editor", "compose"] } } : null;
|
const editorKey: Binding | null = hasComposer ? { keys: ["ctrl+g"], run: openEditor, command: { id: "editor", title: "Write the message in $EDITOR", keywords: ["vim", "editor", "compose"] } } : null;
|
||||||
const nextThreadKey: Binding = { keys: ["ctrl+n", "alt+↓"], label: "ctrl+n/p", run: () => move(1) };
|
const nextThreadKey: Binding = { keys: ["ctrl+n", "alt+↓"], label: "ctrl+n/p", run: () => move(1) };
|
||||||
const previousThreadKey: Binding = { keys: ["ctrl+p", "alt+↑"], run: () => move(-1) };
|
const previousThreadKey: Binding = { keys: ["ctrl+p", "alt+↑"], run: () => move(-1) };
|
||||||
// One-line inputs keep ctrl+u and ctrl+d for editing.
|
// Anywhere with a text field, ctrl+u and ctrl+d edit (delete to line start, delete forward); page up/down still scroll.
|
||||||
const lineInput = mode === "filter";
|
const lineInput = mode === "filter" || mode === "input" || mode === "find" || mode === "palette" || mode === "picker" || mode === "confirm";
|
||||||
const globalKeys = keys(
|
const globalKeys = keys(
|
||||||
quitKey,
|
quitKey,
|
||||||
paletteKey,
|
paletteKey,
|
||||||
|
|||||||
@@ -195,6 +195,14 @@ describe("composer", () => {
|
|||||||
expect(app.calls("sendMessage").map((call) => [call.args[0], call.args[1]])).toEqual([[v2ThreadId, "hello there"]]);
|
expect(app.calls("sendMessage").map((call) => [call.args[0], call.args[1]])).toEqual([[v2ThreadId, "hello there"]]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("ctrl+u deletes to the start of the line rather than scrolling", async () => {
|
||||||
|
const app = await open();
|
||||||
|
await app.press("i");
|
||||||
|
await app.type("hello there");
|
||||||
|
await app.press("u", { ctrl: true });
|
||||||
|
expect(app.frame()).not.toContain("hello there");
|
||||||
|
});
|
||||||
|
|
||||||
test("c starts a new thread draft; esc twice cancels it", async () => {
|
test("c starts a new thread draft; esc twice cancels it", async () => {
|
||||||
const app = await open();
|
const app = await open();
|
||||||
await app.press("c");
|
await app.press("c");
|
||||||
|
|||||||
Reference in new issue
Block a user