diff options
| author | Giuseppe Gadola <giusgadola@gmail.com> | 2023-02-10 13:32:11 +0100 |
|---|---|---|
| committer | Giuseppe Gadola <giusgadola@gmail.com> | 2023-02-10 16:05:59 +0100 |
| commit | 0c16bd6f16eee9aada066e3bd25f6d6d106f91a0 (patch) | |
| tree | 2bd51c87d82ecb99aecbe712f675a6b6b7888091 /lua | |
| parent | refactor(animations): frames are now image objects (diff) | |
fix(animations): fixed invalid buffer id
Diffstat (limited to 'lua')
| -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 |