diff --git a/lua/opencode/core.lua b/lua/opencode/core.lua index 043b7d55..6f08a818 100644 --- a/lua/opencode/core.lua +++ b/lua/opencode/core.lua @@ -51,8 +51,7 @@ function M.open(opts) if are_windows_closed then -- Check if whether prompting will be allowed - local context_module = require('opencode.context') - local mentioned_files = context_module.context.mentioned_files or {} + local mentioned_files = context.context.mentioned_files or {} local allowed, err_msg = util.check_prompt_allowed(config.prompt_guard, mentioned_files) if not allowed then vim.notify(err_msg or 'Prompts will be denied by prompt_guard', vim.log.levels.WARN) @@ -92,8 +91,7 @@ end --- @param opts? SendMessageOpts function M.send_message(prompt, opts) -- Check if prompt is allowed - local context_module = require('opencode.context') - local mentioned_files = context_module.context.mentioned_files or {} + local mentioned_files = context.context.mentioned_files or {} local allowed, err_msg = util.check_prompt_allowed(config.prompt_guard, mentioned_files) if not allowed then @@ -295,7 +293,6 @@ function M.switch_to_mode(mode) end state.current_mode = mode - ui.render_output() return true end