diff options
Diffstat (limited to 'tools/node_modules/eslint/node_modules/inquirer/lib/prompts/rawlist.js')
-rw-r--r-- | tools/node_modules/eslint/node_modules/inquirer/lib/prompts/rawlist.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/rawlist.js b/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/rawlist.js index 4e0bcab0f6..a628b8a746 100644 --- a/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/rawlist.js +++ b/tools/node_modules/eslint/node_modules/inquirer/lib/prompts/rawlist.js @@ -174,7 +174,8 @@ class RawListPrompt extends Base { onArrowKey(type) { var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0; - index += type === 'up' ? -1 : 1; + if (type === 'up') index = index === 0 ? this.opt.choices.length - 1 : index - 1; + else index = index === this.opt.choices.length - 1 ? 0 : index + 1; this.rl.line = String(index + 1); this.onKeypress(); } @@ -204,6 +205,7 @@ function renderChoices(choices, pointer) { if (index === pointer) { display = chalk.cyan(display); } + output += display; }); |