diff options
Diffstat (limited to 'lua/pets/commands.lua')
| -rw-r--r-- | lua/pets/commands.lua | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lua/pets/commands.lua b/lua/pets/commands.lua index da4490d..a240fc0 100644 --- a/lua/pets/commands.lua +++ b/lua/pets/commands.lua @@ -10,8 +10,13 @@ vim.api.nvim_create_user_command("PetsNew", function(input) end if pets.options.random then - local styles = utils.available_pets["dog"] - pet, style = "dog", styles[math.random(#styles)] + local pet_types = {} + for k in pairs(utils.available_pets) do + table.insert(pet_types, k) + end + pet = pet_types[math.random(#pet_types)] + local styles = utils.available_pets[pet] + style = styles[math.random(#styles)] end pets.create_pet(input.args, pet, style) |