88243b846adc61c3e34a60f4c0ae53e3eb8b9e93

Author
Marc Cornellà <marc.cornella@live.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

Use right variable name to avoid zero-length array

This fixes the typographic error that always assigned an undefined
array to `$names`, which made `$list_size` = 0 and triggered a
divide by zero error on the next line.

Diff

 1diff --git a/plugins/emoji/emoji.plugin.zsh b/plugins/emoji/emoji.plugin.zsh
 2index a98d0b714c4794bc9a7744108b2a66066bcc3fe2..adb11bb53801de8afa38f9777ecb3f6a9c178ae6 100644
 3--- a/plugins/emoji/emoji.plugin.zsh
 4+++ b/plugins/emoji/emoji.plugin.zsh
 5@@ -255,7 +255,7 @@ function random_emoji() {
 6   if [[ -z "$group" || "$group" == "all" ]]; then
 7   	names=(${(k)emoji})
 8   else
 9-  	names=(${=emoji_groups[$group_name]})
10+	names=(${=emoji_groups[$group]})
11   fi
12   local list_size=$#names
13   local random_index=$(( ( RANDOM % $list_size ) + 1 ))