complete: Stop using the function definition as the description

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.
This commit is contained in:
Fabian Homborg 2021-04-08 15:32:56 +02:00
parent 4239ba133d
commit e2146a0eee

View File

@ -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;
}