From 2120be93729d04ea966a2977607d22675a4fa44a Mon Sep 17 00:00:00 2001 From: Noah Gorny Date: Sun, 25 Apr 2021 22:04:49 +0300 Subject: [PATCH] plugins: Fix alias-completion by using helper util By using _bash-it-array-contains-element, we can safetly iterate over elements in the $completions array --- plugins/available/alias-completion.plugin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/available/alias-completion.plugin.bash b/plugins/available/alias-completion.plugin.bash index d2cb23b1de..390b10e3cb 100644 --- a/plugins/available/alias-completion.plugin.bash +++ b/plugins/available/alias-completion.plugin.bash @@ -52,7 +52,7 @@ function alias_completion { read -a alias_arg_words <<< "$alias_args" # skip alias if there is no completion function triggered by the aliased command - if [[ ! " ${completions[*]} " =~ $alias_cmd ]]; then + if ! _bash-it-array-contains-element "$alias_cmd" "${completions[@]}"; then if [[ -n "$completion_loader" ]]; then # force loading of completions for the aliased command eval "$completion_loader $alias_cmd"