Skip to content

Commit ca3655d

Browse files
sudo-teeCopilot
andauthored
fix: set current engin to false when setup fails
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6b21c1b commit ca3655d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lua/opencode/ui/completion.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ function M.setup()
6767
setup_success = engine:setup(completion_sources)
6868
end
6969

70-
M._current_engine = engine
71-
72-
if not setup_success then
70+
if setup_success then
71+
M._current_engine = engine
72+
else
73+
M._current_engine = nil
7374
vim.notify(
7475
'Opencode: No completion engine available (engine: ' .. tostring(engine_name) .. ')',
7576
vim.log.levels.WARN

0 commit comments

Comments
 (0)