Skip to content

Commit

Permalink
Merge pull request #15 from andremralves/feat/better-navigation
Browse files Browse the repository at this point in the history
Ctrl+n/Ctrl+p navigation in select prompt
  • Loading branch information
natemoo-re authored Sep 7, 2023
2 parents d4fddc0 + fb2f11f commit deb9485
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-readers-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/cli-kit": patch
---

add support for ctrl+n and ctrl+p navigation in multiselect prompt
2 changes: 2 additions & 0 deletions src/prompt/util/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export const action = (key: Key, isSelect: boolean) => {
if (isSelect) {
if (key.name === 'j') return 'down';
if (key.name === 'k') return 'up';
if (key.ctrl && key.name === 'n') return 'down'
if (key.ctrl && key.name === 'p') return 'up'
}

if (key.name === 'return') return 'submit';
Expand Down

0 comments on commit deb9485

Please sign in to comment.