Skip to content

Commit

Permalink
feat(prompt): add n & p keys for next & previous and left & right for…
Browse files Browse the repository at this point in the history
… next & prev page (#345)
  • Loading branch information
c4spar committed Apr 6, 2022
1 parent dc460b6 commit d568f37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions prompt/_generic_list.ts
Expand Up @@ -96,10 +96,10 @@ export abstract class GenericList<T, V, S extends GenericListSettings<T, V>>
super({
...settings,
keys: {
previous: settings.search ? ["up"] : ["up", "u", "8"],
next: settings.search ? ["down"] : ["down", "d", "2"],
previousPage: ["pageup"],
nextPage: ["pagedown"],
previous: settings.search ? ["up"] : ["up", "u", "p", "8"],
next: settings.search ? ["down"] : ["down", "d", "n", "2"],
previousPage: ["pageup", "left"],
nextPage: ["pagedown", "right"],
...(settings.keys ?? {}),
},
});
Expand Down
2 changes: 2 additions & 0 deletions prompt/figures.ts
Expand Up @@ -41,6 +41,8 @@ export const Figures = Deno.build.os === "windows" ? win : main;
const keyMap: Record<string, keyof typeof Figures> = {
up: "ARROW_UP",
down: "ARROW_DOWN",
left: "ARROW_LEFT",
right: "ARROW_RIGHT",
pageup: "PAGE_UP",
pagedown: "PAGE_DOWN",
tab: "TAB_RIGHT",
Expand Down

0 comments on commit d568f37

Please sign in to comment.