Skip to content

Commit 1e7f649

Browse files
committed
fix: ignore consecutive setup calls
1 parent 1f9089b commit 1e7f649

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/copilot/init.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local M = { client_info = nil }
1+
local M = { setup_done = false }
22
local config = require("copilot.config")
33
local client = require("copilot.client")
44
local highlight = require("copilot.highlight")
@@ -31,6 +31,10 @@ local create_cmds = function (_)
3131
end
3232

3333
M.setup = function(opts)
34+
if M.setup_done then
35+
return
36+
end
37+
3438
local conf = config.setup(opts)
3539

3640
vim.schedule(function ()
@@ -47,6 +51,8 @@ M.setup = function(opts)
4751
end)
4852

4953
highlight.setup()
54+
55+
M.setup_done = true
5056
end
5157

5258
return M

0 commit comments

Comments
 (0)