Skip to content

Commit 21f6bc8

Browse files
committed
feat(core): load context when opening the window
1 parent 872dbba commit 21f6bc8

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
@@ -49,6 +49,10 @@ function M.open(opts)
4949

5050
local are_windows_closed = state.windows == nil
5151

52+
if not require('opencode.ui.ui').is_opencode_focused() then
53+
require('opencode.context').load()
54+
end
55+
5256
if are_windows_closed then
5357
-- Check if whether prompting will be allowed
5458
local context_module = require('opencode.context')

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)