From 30e6b5a710319e354c3e362deb7819cb2135c417 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3n=C3=A1n=20Carrigan?= Date: Wed, 9 Nov 2022 08:43:57 +0000 Subject: [PATCH] fix(windows): rerender while windows exist The changes to window animator mean we don't need to track if any windows were updated, just checking if windows exist is sufficient to keep rendering. See #154 --- lua/notify/windows/init.lua | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lua/notify/windows/init.lua b/lua/notify/windows/init.lua index acaac93..8c0903c 100644 --- a/lua/notify/windows/init.lua +++ b/lua/notify/windows/init.lua @@ -30,15 +30,13 @@ end function WindowAnimator:render(queue, time) self:push_pending(queue) if vim.tbl_isempty(self.win_stages) then - return nil + return false end - local updated = false local open_windows = vim.tbl_keys(self.win_stages) for win, _ in pairs(self.win_stages) do - local res = self:_update_window(time, win, open_windows) - updated = updated or res + self:_update_window(time, win, open_windows) end - return updated + return true end function WindowAnimator:push_pending(queue) @@ -152,7 +150,6 @@ function WindowAnimator:_update_window(time, win, open_windows) if not win_goals then self:_remove_win(win) - return true end -- If we don't animate, then we move to all goals instantly. @@ -177,13 +174,11 @@ function WindowAnimator:_update_window(time, win, open_windows) self:_start_timer(win) end - local updated = self:_advance_win_state(win, win_goals, time) + self:_advance_win_state(win, win_goals, time) if self:_is_complete(win, win_goals) and not win_goals.time then self:_advance_win_stage(win) end - - return updated end function WindowAnimator:_is_complete(win, goals)