diff options
| author | Giuseppe Gadola <giusgadola@gmail.com> | 2023-02-10 17:38:05 +0100 |
|---|---|---|
| committer | Giuseppe Gadola <giusgadola@gmail.com> | 2023-02-10 17:38:05 +0100 |
| commit | 852769fb98e346e2b2c98808d3816ca4ecd20913 (patch) | |
| tree | 6dc99cc082122c4b582cae5e98691ac12bdcb3ff /lua/pets/pet.lua | |
| parent | feat(commands): added the list pets command (diff) | |
refactor(popup): create popup directly inside the Pet class
Diffstat (limited to 'lua/pets/pet.lua')
| -rw-r--r-- | lua/pets/pet.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lua/pets/pet.lua b/lua/pets/pet.lua index f0e6cfa..4f31792 100644 --- a/lua/pets/pet.lua +++ b/lua/pets/pet.lua @@ -2,6 +2,21 @@ local M = {} M.Pet = {} M.Pet.__index = M.Pet +local popup_opts = { + position = { + row = "100%", + col = "100%", + }, + size = { + width = "25%", + height = 10, + }, + focusable = false, + enter = false, + win_options = { + winblend = 100, + }, +} -- @param name the actual name for the pet -- @param type the species of the pet e.g. cat -- @param style the color/style of the pet e.g. brown @@ -17,6 +32,7 @@ function M.Pet.new(name, type, style) instance.animation = require("pets.animations").Animation.new(instance.sourcedir, type, style) instance.popup = require("pets.popup").popup + instance.popup = require("nui.popup")(popup_opts) return instance end |