From e2146a0eee0a248de603b2ffdca5e33fc3cd9c3b Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 8 Apr 2021 15:32:56 +0200 Subject: [PATCH] complete: Stop using the function definition as the description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This isn't helpful, and entirely unreadable. Excerpt: ``` __fish_git_prompt_set_char (set -l user_variable_name "$argv[1]" set -l char $argv[2] if set -q argv[3] and begin set -q __fish_git_prompt_show_informative_status or set -q __fi…) ``` Fixes #7911. --- src/complete.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/complete.cpp b/src/complete.cpp index 380b473ef..65c21ada4 100644 --- a/src/complete.cpp +++ b/src/complete.cpp @@ -713,14 +713,7 @@ void completer_t::complete_cmd_desc(const wcstring &str) { /// Returns a description for the specified function, or an empty string if none. static wcstring complete_function_desc(const wcstring &fn) { wcstring result; - bool has_description = function_get_desc(fn, result); - if (!has_description) { - function_get_definition(fn, result); - // A completion description is a single line. - for (wchar_t &c : result) { - if (c == L'\n') c = L' '; - } - } + function_get_desc(fn, result); return result; }