File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,6 +24,15 @@ function M.pass_gate()
2424 gate_passed = true
2525 require (" copilot.suggestion" ).setup ()
2626 require (" copilot.panel" ).setup ()
27+
28+ -- Set suggestion keymaps on buffers that were attached before auth passed
29+ local client = c .get ()
30+ if client then
31+ local suggestion = require (" copilot.suggestion" )
32+ for _ , bufnr in ipairs (vim .lsp .get_buffers_by_client_id (client .id )) do
33+ suggestion .set_keymap (bufnr )
34+ end
35+ end
2736end
2837
2938--- @return boolean
Original file line number Diff line number Diff line change @@ -102,7 +102,9 @@ function M.buf_attach(force, bufnr)
102102 end
103103
104104 vim .lsp .buf_attach_client (bufnr , M .id )
105- require (" copilot.suggestion" ).set_keymap (bufnr )
105+ if require (" copilot.auth" ).is_gate_passed () then
106+ require (" copilot.suggestion" ).set_keymap (bufnr )
107+ end
106108 require (" copilot.nes" ).set_keymap (bufnr )
107109
108110 util .set_buffer_previous_ft (bufnr , vim .bo [bufnr ].filetype )
You can’t perform that action at this time.
0 commit comments