fix zsh serialization of directory candidates ending with /
This commit is contained in:
parent
33a3e3fb61
commit
6860f7ffd6
1 changed files with 2 additions and 2 deletions
|
|
@ -277,8 +277,8 @@ def fmt_desc(word: str, desc: str, max_word_len: int) -> Iterator[str]:
|
|||
allm = tuple(matches)
|
||||
if len(allm) > 1:
|
||||
common_prefix = os.path.commonprefix(allm)
|
||||
if common_prefix and '/' in common_prefix:
|
||||
common_prefix = os.path.dirname(common_prefix) + '/'
|
||||
if common_prefix and os.sep in common_prefix:
|
||||
common_prefix = os.path.dirname(common_prefix).rstrip(os.sep) + os.sep
|
||||
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())
|
||||
|
|
|
|||
Loading…
Reference in a new issue