diff options
Diffstat (limited to 'lua/pets')
| -rw-r--r-- | lua/pets/animations.lua | 4 |
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 |