Skip to content

Commit b9300fb

Browse files
committed
fix: incorrect buffer attach logic
Introduced in previous commit Fixes #405
1 parent 99654fe commit b9300fb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lua/copilot/client.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,12 @@ function M.buf_attach(force)
103103
local bufnr = vim.api.nvim_get_current_buf()
104104
local bufname = vim.api.nvim_buf_get_name(bufnr)
105105

106-
if not force and not M.should_attach(bufnr, bufname) and not util.should_attach() then
106+
-- if force or (M.should_attach and M.should_attach(bufnr, bufname)) then
107+
-- do stuff
108+
-- end
109+
110+
if not (force or (M.should_attach(bufnr, bufname) and util.should_attach())) then
111+
logger.debug("not attaching to buffer based on force and should_attach criteria")
107112
return
108113
end
109114

0 commit comments

Comments
 (0)