diff options
| author | Giuseppe Gadola <giusgadola@gmail.com> | 2023-02-10 17:45:38 +0100 |
|---|---|---|
| committer | Giuseppe Gadola <giusgadola@gmail.com> | 2023-02-10 17:45:38 +0100 |
| commit | f3e45780dad4a28233a37e4773fea0372f993735 (patch) | |
| tree | 4ce5b3a6f525c5f257fbb3a4a8ffa12eb681889b /lua/pets/pet.lua | |
| parent | refactor(popup): create popup directly inside the Pet class (diff) | |
feat(animations): use row and col options
Diffstat (limited to 'lua/pets/pet.lua')
| -rw-r--r-- | lua/pets/pet.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lua/pets/pet.lua b/lua/pets/pet.lua index 4f31792..e5dca4d 100644 --- a/lua/pets/pet.lua +++ b/lua/pets/pet.lua @@ -1,4 +1,5 @@ local M = {} + M.Pet = {} M.Pet.__index = M.Pet @@ -21,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) +function M.Pet.new(name, type, style, row, col) local instance = setmetatable({}, M.Pet) instance.name = name instance.type = type @@ -30,8 +31,7 @@ function M.Pet.new(name, type, style) local wd = debug.getinfo(1).source:sub(2):match("(.*nvim/)") .. "media/" instance.sourcedir = wd .. type .. "/" .. style .. "/" - instance.animation = require("pets.animations").Animation.new(instance.sourcedir, type, style) - instance.popup = require("pets.popup").popup + instance.animation = require("pets.animations").Animation.new(instance.sourcedir, type, style, row, col) instance.popup = require("nui.popup")(popup_opts) return instance end |