From 7a52f633f4e419af44faf5df2d9e8613289f170b Mon Sep 17 00:00:00 2001 From: Thomas Preisner Date: Thu, 30 Mar 2023 20:13:15 +0200 Subject: [PATCH] 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). --- zsh/completion.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zsh/completion.zsh b/zsh/completion.zsh index 91e87f6..2f38e37 100644 --- a/zsh/completion.zsh +++ b/zsh/completion.zsh @@ -51,7 +51,9 @@ zstyle ':completion:::::' completer \ #TODO: keep _prefix or not? # 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 zstyle -e ':completion:*:approximate:*' max-errors \