Skip to content

Commit 780325e

Browse files
committed
refactor(render): helper for loading full session
Will use with testing, I think
1 parent a3ee9d2 commit 780325e

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lua/opencode/ui/renderer.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,17 @@ function M.render_full_session()
8282
return
8383
end
8484

85-
fetch_session():and_then(function(session_data)
86-
M.reset()
85+
fetch_session():and_then(M._render_full_session_data)
86+
end
87+
88+
function M._render_full_session_data(session_data)
89+
M.reset()
8790

88-
state.messages = session_data
89-
local output_data = formatter._format_messages(state.active_session)
91+
state.messages = session_data
92+
local output_data = formatter._format_messages(state.active_session)
9093

91-
M.write_output(output_data)
92-
M.scroll_to_bottom()
93-
end)
94+
M.write_output(output_data)
95+
M.scroll_to_bottom()
9496
end
9597

9698
---Shift cached line positions by delta starting from from_line

0 commit comments

Comments
 (0)