From 606ce4e66f9f1d4683107c1be8b531edcca8f578 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Jul 2021 08:53:11 +0530 Subject: [PATCH] Add descriptions to fish completions --- kitty/complete.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kitty/complete.py b/kitty/complete.py index d088fd7d3..2c6d5f8cc 100644 --- a/kitty/complete.py +++ b/kitty/complete.py @@ -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)