From b1b5af23b61269f50c73c59be427f0c3d7f6275c Mon Sep 17 00:00:00 2001 From: Sorin Ionescu Date: Tue, 25 Sep 2012 17:27:16 -0400 Subject: [PATCH] Check for empty values in $key_info properly --- modules/editor/init.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/editor/init.zsh b/modules/editor/init.zsh index 5f035b6..b36cfa2 100644 --- a/modules/editor/init.zsh +++ b/modules/editor/init.zsh @@ -95,9 +95,10 @@ key_info=( ) # Do not bind any keys if there are empty values in $key_info. -for key in "$key_info[@]"; do - if [[ -z "$key" ]]; then +for key in "${(k)key_info[@]}"; do + if [[ -z "$key_info[$key]" ]]; then print "prezto: one or more keys are non-bindable" >&2 + unset key{,_info} return 1 fi done