diff --git a/packages/editor/src/index.mts b/packages/editor/src/index.mts index d56e9aac4..8a5f050d6 100644 --- a/packages/editor/src/index.mts +++ b/packages/editor/src/index.mts @@ -73,11 +73,13 @@ export default createPrompt((config, done) => { const isLoading = status === 'loading'; const prefix = usePrefix(isLoading); - let message = chalk.bold(config.message); + const message = chalk.bold(config.message); + + let helpTip; if (status === 'loading') { - message += chalk.dim(' Received'); + helpTip = chalk.dim('Received'); } else if (status === 'pending') { - message += chalk.dim(' Press to launch your preferred editor.'); + helpTip = chalk.dim('Press to launch your preferred editor.'); } let error = ''; @@ -85,5 +87,5 @@ export default createPrompt((config, done) => { error = chalk.red(`> ${errorMsg}`); } - return [`${prefix} ${message}`, error]; + return [[prefix, message, helpTip].filter(Boolean).join(' '), error]; });