File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed
Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ Install the plugin with your preferred plugin manager.
5050For example, with [ packer.nvim] ( https://github.com/wbthomason/packer.nvim ) :
5151
5252``` lua
53- use { " zbirenbaum/copilot.lua"
53+ use { " zbirenbaum/copilot.lua"
5454 requires = {
5555 " copilotlsp-nvim/copilot-lsp" , -- (optional) for NES functionality
5656 },
@@ -198,14 +198,14 @@ require('copilot').setup({
198198 root_dir = function ()
199199 return vim .fs .dirname (vim .fs .find (" .git" , { upward = true })[1 ])
200200 end ,
201- should_attach = function (_ , _ )
202- if not vim .bo .buflisted then
201+ should_attach = function (buf_id , _ )
202+ if not vim .bo [ buf_id ] .buflisted then
203203 logger .debug (" not attaching, buffer is not 'buflisted'" )
204204 return false
205205 end
206206
207- if vim .bo .buftype ~= " " then
208- logger .debug (" not attaching, buffer 'buftype' is " .. vim .bo .buftype )
207+ if vim .bo [ buf_id ] .buftype ~= " " then
208+ logger .debug (" not attaching, buffer 'buftype' is " .. vim .bo [ buf_id ] .buftype )
209209 return false
210210 end
211211
Original file line number Diff line number Diff line change @@ -4,14 +4,14 @@ local logger = require("copilot.logger")
44
55local should_attach = {
66 --- @type ShouldAttachFunc
7- default = function (_ , _ )
8- if not vim .bo .buflisted then
7+ default = function (buf_id , _ )
8+ if not vim .bo [ buf_id ] .buflisted then
99 logger .debug (" not attaching, buffer is not 'buflisted'" )
1010 return false
1111 end
1212
13- if vim .bo .buftype ~= " " then
14- logger .debug (" not attaching, buffer 'buftype' is " .. vim .bo .buftype )
13+ if vim .bo [ buf_id ] .buftype ~= " " then
14+ logger .debug (" not attaching, buffer 'buftype' is " .. vim .bo [ buf_id ] .buftype )
1515 return false
1616 end
1717
You can’t perform that action at this time.
0 commit comments