From 00739ba5c539ac09c14590f610fc96411165b9e2 Mon Sep 17 00:00:00 2001 From: Giuseppe Gadola Date: Sat, 11 Feb 2023 21:27:59 +0100 Subject: refactor(options): options are passed directly as a table --- lua/pets/pet.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lua/pets/pet.lua') diff --git a/lua/pets/pet.lua b/lua/pets/pet.lua index 424f138..1b1249e 100644 --- a/lua/pets/pet.lua +++ b/lua/pets/pet.lua @@ -9,7 +9,7 @@ local popup_opts = { col = "100%", }, size = { - width = "25%", + width = "30%", height = 10, }, focusable = false, @@ -22,7 +22,7 @@ local popup_opts = { -- @param type the species of the pet e.g. cat -- @param style the color/style of the pet e.g. brown -- @return a new Pet instance -function M.Pet.new(name, type, style, row, col) +function M.Pet.new(name, type, style, user_opts) local instance = setmetatable({}, M.Pet) instance.name = name instance.type = type @@ -36,9 +36,8 @@ function M.Pet.new(name, type, style, row, col) instance.sourcedir, type, style, - row, - col, - instance.popup.win_config.width + instance.popup.win_config.width, + user_opts ) return instance end -- cgit v1.3-2-g11bf