From 3a746a7ee152d923812487987a7a0e9618ea7f02 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Sun, 23 Mar 2025 23:46:04 +0900 Subject: [PATCH] refactor(alias-finder): Simplify --longer option activation --- plugins/alias-finder/alias-finder.plugin.zsh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index a97bf94c2..19f747f4b 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -24,9 +24,7 @@ alias-finder() { ## - add escaping character to special characters cmd=$(echo -n "$cmd" | tr '\n' ' ' | xargs | tr -s '[:space:]' | sed 's/[].\|$(){}?+*^[]/\\&/g') - if [[ $longer == true ]]; then - wordEnd="" # remove wordEnd to find longer aliases - fi + $longer && wordEnd=".*$" # find with alias and grep, removing last word each time until no more words while [[ $cmd != "" ]]; do