Skip to content

Commit 52c4092

Browse files
committed
feat(core): load context when opening the window
1 parent 0cae2dc commit 52c4092

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lua/opencode/core.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ function M.open(opts)
4747

4848
local are_windows_closed = state.windows == nil
4949

50+
if not require('opencode.ui.ui').is_opencode_focused() then
51+
require('opencode.context').load()
52+
end
53+
5054
if are_windows_closed then
5155
state.windows = ui.create_windows()
5256
end

lua/opencode/ui/ui.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ function M.create_windows()
8383
local autocmds = require('opencode.ui.autocmds')
8484

8585
if not require('opencode.ui.ui').is_opencode_focused() then
86-
require('opencode.context').load()
8786
state.last_code_win_before_opencode = vim.api.nvim_get_current_win()
8887
state.current_code_buf = vim.api.nvim_get_current_buf()
8988
end

0 commit comments

Comments
 (0)