Add descriptions to fish completions

This commit is contained in:
Kovid Goyal 2021-07-17 08:53:11 +05:30
parent a10c19456a
commit 606ce4e66f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -307,8 +307,11 @@ def fish_output_serializer(ans: Completions) -> str:
def fish2_output_serializer(ans: Completions) -> str:
lines = []
for description, matches in ans.match_groups.items():
for word in matches:
lines.append(word.replace('\n', ' '))
for word, desc in matches.items():
q = word
if desc:
q = f'{q}\t{desc}'
lines.append(q.replace('\n', ' '))
# debug('\n'.join(lines))
return '\n'.join(lines)