Skip to content

Commit

Permalink
fix(summary): check for pending renders
Browse files Browse the repository at this point in the history
  • Loading branch information
Rónán Carrigan committed Aug 2, 2022
1 parent 75e74de commit c76f3be
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/neotest/consumers/summary/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ local components = {}
local render_cond = async.control.Condvar.new()

local focused
local pending_render = false
local all_expanded = {}
local function render(expanded)
if not is_open() then
Expand All @@ -70,12 +71,16 @@ local function render(expanded)
for pos_id, _ in pairs(expanded or {}) do
all_expanded[pos_id] = true
end
pending_render = true
render_cond:notify_all()
end

async.run(function()
while true do
render_cond:wait()
if not pending_render then
render_cond:wait()
end
pending_render = false
local canvas = Canvas.new(config.summary)
if not client:has_started() then
canvas:write("Parsing tests")
Expand Down

0 comments on commit c76f3be

Please sign in to comment.