zsh: split matcher into smaller matchers to fix matching

Starting with zsh version 5.9, the completion behavior changed slightly
(potentially due to the changed behavior of zstyle). As a result, The
matching was broken for directories with the same prefix followed by a
minus and further text (e.g. test-cut, test-bar).
This commit is contained in:
Thomas Preisner 2023-03-30 20:13:15 +02:00
parent 53f83393dc
commit 7a52f633f4

View file

@ -51,7 +51,9 @@ zstyle ':completion:::::' completer \
#TODO: keep _prefix or not? #TODO: keep _prefix or not?
# ignore case when trying to match typed characters # ignore case when trying to match typed characters
zstyle ':completion:*:(^approximate):*' matcher-list 'm:{a-zA-Z-_}={A-Za-z_-}' zstyle ':completion:*:(^approximate):*' matcher-list 'm:{[:lower:]}={[:upper:]}' \
'+m:{[:upper:]}={[:lower:]}' \
'+m:{-_}={_-}'
# allow one mistake per three characters # allow one mistake per three characters
zstyle -e ':completion:*:approximate:*' max-errors \ zstyle -e ':completion:*:approximate:*' max-errors \