Skip to content

Commit

Permalink
[Fix sorin-ionescu#351] Set empty keys to an invalid UTF-8 sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
sorin-ionescu committed Jan 29, 2013
1 parent 1852350 commit f4d9b32
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/editor/init.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,11 @@ key_info=(
'BackTab' "$terminfo[kcbt]"
)

# Do not bind any keys if there are empty values in $key_info.
# Set empty $key_info values to an invalid UTF-8 sequence to induce silent
# bindkey failure.
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
key_info["$key"]=''
fi
done

Expand Down

0 comments on commit f4d9b32

Please sign in to comment.