Skip to content

Commit c571581

Browse files
committed
fix(context): respect global context enabled=false
1 parent 6219e25 commit c571581

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

lua/opencode/context.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ function M.unload_attachments()
130130
end
131131

132132
function M.load()
133-
-- Delegate to ChatContext which manages the global state
134133
ChatContext.load()
135134
state.context_updated_at = vim.uv.now()
136135
end

lua/opencode/context/base_context.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ function M.is_context_enabled(context_key, context_config)
2626
end
2727
end
2828

29+
local is_globally_enabled = vim.tbl_get(config --[[@as table]], 'context', 'enabled')
30+
if is_globally_enabled == false then
31+
return false
32+
end
33+
2934
local is_enabled = vim.tbl_get(config --[[@as table]], 'context', context_key, 'enabled')
3035
local is_state_enabled = vim.tbl_get(state, 'current_context_config', context_key, 'enabled')
3136

0 commit comments

Comments
 (0)