Skip to content

Commit ff9a8a3

Browse files
committed
test(replay): extract index so it's right
Since the replay_event is scheduled, M.current_index is at the stopping point by the time the callback runs. The event is scheduled so individual logs don't trigger a big messages display
1 parent dcb425d commit ff9a8a3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/manual/streaming_renderer_replay.lua

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,13 @@ function M.emit_event(event)
8383
return
8484
end
8585

86+
local index = M.current_index
87+
local count = #M.events
8688
vim.schedule(function()
8789
local id = event.properties.info and event.properties.info.id
8890
or event.properties.part and event.properties.part.id
8991
or ''
90-
vim.notify(
91-
'Event ' .. M.current_index .. '/' .. #M.events .. ': ' .. event.type .. ' ' .. id .. '',
92-
vim.log.levels.INFO
93-
)
92+
vim.notify('Event ' .. index .. '/' .. count .. ': ' .. event.type .. ' ' .. id .. '', vim.log.levels.INFO)
9493
helpers.replay_event(event)
9594
end)
9695
end

0 commit comments

Comments
 (0)