[READ-ONLY] Mirror of https://github.com/bombshell-dev/clack. Effortlessly build beautiful command-line apps bomb.sh/docs/clack/basics/getting-started/
cli command-line command-line-app node prompt prompts
5

Configure Feed

Select the types of activity you want to include in your feed.

feat(#45): add support for neovim cursor motion

Nate Moore (Feb 17, 2023, 5:18 AM -0600) 6d9e675a b5e78cb9

+9 -1
+5
.changeset/tough-drinks-cheat.md
··· 1 + --- 2 + '@clack/core': patch 3 + --- 4 + 5 + Add support for neovim cursor motion (`hjkl`)
+4 -1
packages/core/src/prompts/prompt.ts
··· 29 29 if ((input as typeof stdin).isTTY) (input as typeof stdin).setRawMode(value); 30 30 } 31 31 32 + const aliases = new Map([['k', 'up'], ['j', 'down'], ['h', 'left'], ['l', 'right']]); 32 33 const keys = new Set(['up', 'down', 'left', 'right', 'space', 'enter']); 33 34 34 35 export interface PromptOptions<Self extends Prompt> { ··· 147 148 if (this.state === 'error') { 148 149 this.state = 'active'; 149 150 } 150 - 151 + if (key?.name && !this._track && aliases.has(key.name)) { 152 + this.emit('cursor', aliases.get(key.name)); 153 + } 151 154 if (key?.name && keys.has(key.name)) { 152 155 this.emit('cursor', key.name); 153 156 }