From 95221d58c983fcab8ca62557871ecc1471f63114 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 19 May 2023 07:00:12 -0700 Subject: [PATCH] closer --- aider/ctags.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/aider/ctags.py b/aider/ctags.py index 51ced3a9f..2503dc5ae 100644 --- a/aider/ctags.py +++ b/aider/ctags.py @@ -4,19 +4,28 @@ import sys def print_tags_info(filename): last = None + last_prefix = None tags = sorted(get_tags(filename)) for tag in tags: if last is None: show = tag + prefix = None else: show = [] + prefix = [] + stop = False for lst, tg in zip(last, tag): - if lst == tg: + if lst == tg and not stop: + prefix.append(lst) show.append("") else: + stop = True show.append(tg) + if prefix != last_prefix: + print(prefix) + last_prefix = prefix if not show[-1]: show = show[:-1] show = "\t".join(show)