File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -64,14 +64,17 @@ function M.buf_attach(force)
64
64
65
65
logger .trace (" attaching to buffer" )
66
66
67
- -- This could cause slowdowns when going into Insert mode
68
- if not vim .lsp .buf_is_attached (bufnr , M .id ) then
67
+ if not M .id then
69
68
M .ensure_client_started ()
69
+ end
70
70
71
- if not M .id then
72
- return
73
- end
71
+ if not M .id then
72
+ logger .trace (" failed to start copilot client" )
73
+ return
74
+ end
74
75
76
+ -- This could cause slowdowns when going into Insert mode
77
+ if not vim .lsp .buf_is_attached (bufnr , M .id ) then
75
78
vim .lsp .buf_attach_client (bufnr , M .id )
76
79
logger .trace (" explicitly attached client to buffer" )
77
80
end
@@ -156,7 +159,7 @@ function M.setup()
156
159
end ),
157
160
})
158
161
159
- M .ensure_client_started ( )
162
+ vim . schedule ( M .ensure_client_started )
160
163
end
161
164
162
165
function M .teardown ()
You can’t perform that action at this time.
0 commit comments