Skip to content

Commit 72ddb92

Browse files
committed
fix(xfunc ARRAY filter): accept command name as predicate
1 parent 40a204e commit 72ddb92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

completions/ARRAY

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ _comp_xfunc_ARRAY_filter()
9393
esac
9494
;;
9595
*)
96-
if declare -F "$2" &>/dev/null; then
96+
if type -t "$2" &>/dev/null; then
9797
_comp_local_predicate="$2 \"\$_comp_local_value\""
9898
else
99-
_comp_local_predicate="local value=\$_comp_local_value; $2"
99+
_comp_local_predicate="local -x value=\$_comp_local_value; $2"
100100
fi
101101
;;
102102
esac

0 commit comments

Comments
 (0)