From 6af4b7bf76877a28d5e162d278687906642b72b3 Mon Sep 17 00:00:00 2001 From: Lex Date: Thu, 2 May 2024 14:47:15 -0400 Subject: [PATCH] rendering autocomplete option description only when the option is hovered --- lib/elements/autocomplete.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elements/autocomplete.js b/lib/elements/autocomplete.js index 8e06da21..203840f4 100644 --- a/lib/elements/autocomplete.js +++ b/lib/elements/autocomplete.js @@ -219,7 +219,7 @@ class AutocompletePrompt extends Prompt { let prefix = isStart ? figures.arrowUp : isEnd ? figures.arrowDown : ' '; let title = hovered ? color.cyan().underline(v.title) : v.title; prefix = (hovered ? color.cyan(figures.pointer) + ' ' : ' ') + prefix; - if (v.description) { + if (v.description && hovered) { desc = ` - ${v.description}`; if (prefix.length + title.length + desc.length >= this.out.columns || v.description.split(/\r?\n/).length > 1) {