From d860c7548f05621c9df8fe315a8d68eae2c9c8c7 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Sun, 23 Mar 2025 23:44:51 +0900 Subject: [PATCH] doc(alias-finder): Add note for defect in option settings --- plugins/alias-finder/alias-finder.plugin.zsh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index 3ed1dbb0a..a97bf94c2 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -1,19 +1,18 @@ alias-finder() { - local cmd=" " exact="" longer="" cheaper="" wordEnd="'{0,1}$" finder="" filter="" + local cmd=" " exact=false longer=false cheaper=false wordEnd="'?$" finder="" filter="" - # build command and options + # setup options + # XXX: This logic has flaw. If user enable options with zstyle, there's no way to disable it. + # It's because same function is used for autoload hook and manual execution. + # I believe manual execution is very minor in use, so I'll keep it as is for now. for c in "$@"; do case $c in - # TODO: Remove backward compatibility (other than zstyle form) - # set options if exist -e|--exact) exact=true;; -l|--longer) longer=true;; -c|--cheaper) cheaper=true;; - # concatenate cmd *) cmd="$cmd$c " ;; esac done - zstyle -t ':omz:plugins:alias-finder' longer && longer=true zstyle -t ':omz:plugins:alias-finder' exact && exact=true zstyle -t ':omz:plugins:alias-finder' cheaper && cheaper=true