Skip to content

Commit

Permalink
Merge pull request #15 from LexBorisoff/fix/multiselect-instructions-…
Browse files Browse the repository at this point in the history
…newline

fix(lib): normalized newlines after instructions in multiselect prompts
  • Loading branch information
LexBorisoff authored Jan 22, 2025
2 parents 229b778 + abe4d4b commit f32d27b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions lib/elements/autocompleteMultiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,17 @@ Instructions:
${figures.arrowUp}/${figures.arrowDown}: Highlight option
${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection
[a,b,c]/delete: Filter choices
enter/return: Complete answer
`;
enter/return: Complete answer\n`;
}
return '';
}

renderCurrentInput() {
return `
Filtered results for: ${this.inputValue ? this.inputValue : color.gray('Enter something to filter')}\n`;
return `\nFiltered results for: ${
this.inputValue
? this.inputValue
: color.gray('Enter something to filter')
}\n`;
}

renderOption(cursor, v, i, arrowIndicator) {
Expand Down
2 changes: 1 addition & 1 deletion lib/elements/multiselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class MultiselectPrompt extends Prompt {
` ${figures.arrowUp}/${figures.arrowDown}: Highlight option\n` +
` ${figures.arrowLeft}/${figures.arrowRight}/[space]: Toggle selection\n` +
(this.maxChoices === undefined ? ` a: Toggle all\n` : '') +
` enter/return: Complete answer`
` enter/return: Complete answer\n`
);
}
return '';
Expand Down

0 comments on commit f32d27b

Please sign in to comment.