Skip to content

Commit 045daa5

Browse files
committed
fix: prevent calling buf_attach_client without a client id
1 parent 2c3d15c commit 045daa5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lua/copilot/client/init.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ function M.buf_attach(force)
6666

6767
-- This could cause slowdowns when going into Insert mode
6868
if not vim.lsp.buf_is_attached(bufnr, M.id) then
69+
M.ensure_client_started()
70+
71+
if not M.id then
72+
return
73+
end
74+
6975
vim.lsp.buf_attach_client(bufnr, M.id)
7076
logger.trace("explicitly attached client to buffer")
7177
end

0 commit comments

Comments
 (0)