Skip to content

Commit d0f2c8e

Browse files
committed
fix(core): don't refresh on every switch to input
1 parent c95c487 commit d0f2c8e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lua/opencode/core.lua

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,14 @@ function M.open(opts)
5858
if not state.active_session then
5959
state.active_session = session.get_last_workspace_session()
6060
else
61-
if not state.display_route then
61+
if not state.display_route and are_windows_closed then
6262
-- We're not displaying /help or something like that but we have an active session
63-
-- so we need to do a full refresh. This mostly happens when opening the window
64-
-- after having closed it since we're not currently clearing the session on api.close()
63+
-- and the windows were closed so we need to do a full refresh. This mostly happens
64+
-- when opening the window after having closed it since we're not currently clearing
65+
-- the session on api.close()
6566
ui.render_output(false)
6667
end
6768
end
68-
69-
-- if (are_windows_closed or ui.is_output_empty()) and not state.display_route then
70-
-- ui.render_output(true)
71-
-- ui.scroll_to_bottom()
72-
-- end
7369
end
7470

7571
if opts.focus == 'input' then

0 commit comments

Comments
 (0)