Skip to content

Commit

Permalink
fix(windows): rerender while windows exist
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rcarriga committed Nov 9, 2022
1 parent ba270de commit 30e6b5a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions lua/notify/windows/init.lua
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand All @@ -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)
Expand Down

0 comments on commit 30e6b5a

Please sign in to comment.