aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorGiuseppe Gadola <giusgadola@gmail.com>2023-02-10 13:32:11 +0100
committerGiuseppe Gadola <giusgadola@gmail.com>2023-02-10 16:05:59 +0100
commit0c16bd6f16eee9aada066e3bd25f6d6d106f91a0 (patch)
tree2bd51c87d82ecb99aecbe712f675a6b6b7888091 /lua
parentrefactor(animations): frames are now image objects (diff)
fix(animations): fixed invalid buffer id
Diffstat (limited to 'lua')
-rw-r--r--lua/pets/animations.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/lua/pets/animations.lua b/lua/pets/animations.lua
index 0629727..970274b 100644
--- a/lua/pets/animations.lua
+++ b/lua/pets/animations.lua
@@ -50,7 +50,9 @@ end
function M.Animation:next_frame()
self.frame_counter = self.frame_counter + 1
- vim.api.nvim_buf_set_lines(self.bufnr, 0, -1, false, lines)
+ if vim.api.nvim_buf_is_valid(self.bufnr) then
+ vim.api.nvim_buf_set_lines(self.bufnr, 0, -1, false, lines)
+ end
if not self.current_image then
self.frame_counter = 1
else