Skip to content

Commit 49f6cb8

Browse files
committed
feat(config): event_collapsing, defaults on
1 parent 8b3b7f9 commit 49f6cb8

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

lua/opencode/config.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ M.defaults = {
9595
markdown_debounce_ms = 250,
9696
on_data_rendered = nil,
9797
event_throttle_ms = 40,
98+
event_collapsing = true,
9899
},
99100
tools = {
100101
show_output = true,

lua/opencode/event_manager.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,14 @@ end
225225
function EventManager:_on_drained_events(events)
226226
self:emit('custom.emit_events.started', {})
227227

228+
if not config.ui.output.rendering.event_collapsing then
229+
for _, event in ipairs(events) do
230+
self:emit(event.type, event.properties)
231+
end
232+
self:emit('custom.emit_events.finished', {})
233+
return
234+
end
235+
228236
local collapsed_events = {}
229237
local part_update_indices = {}
230238

tests/manual/renderer_replay.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ function M.start(opts)
343343

344344
M.setup_windows(opts)
345345

346+
-- NOTE: the index numbers will be incorrect when event collapsing happens
346347
local log_event = function(type, event)
347348
local index = M.current_index
348349
local count = #M.events

0 commit comments

Comments
 (0)