common prefix should not apply to basename

This commit is contained in:
Kovid Goyal 2021-07-21 18:59:18 +05:30
parent 8795bf8cf9
commit 92f428b6d1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -254,6 +254,7 @@ def zsh_output_serializer(ans: Completions) -> str:
if len(allm) > 1:
common_prefix = os.path.commonprefix(allm)
if common_prefix and '/' in common_prefix:
common_prefix = os.path.dirname(common_prefix) + '/'
cmd.extend(('-p', shlex.quote(common_prefix)))
matches = MatchGroup({k[len(common_prefix):]: v for k, v in matches.items()})
has_descriptions = any(matches.values())