From 92fb85e498d80ea341d15225641d774d8edebce8 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Mon, 24 Mar 2025 00:00:12 +0900 Subject: [PATCH] refactor(alias-finder): Add meaningful variable name for finder variable part --- plugins/alias-finder/alias-finder.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index a9ef132f2..a4c1d2423 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -1,5 +1,5 @@ alias-finder() { - local cmd=" " exact=false longer=false cheaper=false wordEnd="'?$" finder="" filter="" + local cmd=" " exact=false longer=false cheaper=false wordStart="^'?" wordEnd="'?$" finder="" filter="" # setup options # XXX: This logic has flaw. If user enable options with zstyle, there's no way to disable it. @@ -28,7 +28,7 @@ alias-finder() { # find with alias and grep, removing last word each time until no more words while [[ $cmd != "" ]]; do - finder="'{0,1}$cmd$wordEnd" + finder="$wordStart$cmd$wordEnd" # make filter to find only shorter results than current cmd if [[ $cheaper == true ]]; then