Skip to content

Commit f55bf8c

Browse files
committed
fix: prevent manually disabled buffer from automatically re-attaching
Fixes zbirenbaum#536
1 parent 04d3760 commit f55bf8c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lua/copilot/client/init.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ function M.buf_attach(force, bufnr)
6060
return
6161
end
6262

63+
if (not force) and util.get_buffer_attach_status(bufnr) == ATTACH_STATUS_MANUALLY_DETACHED then
64+
logger.trace("buffer not attaching as it was manually detached")
65+
return
66+
end
67+
6368
if lsp.initialization_failed() then
6469
logger.error("copilot-language-server failed to initialize")
6570
M.startup_error = "initialization of copilot-language-server failed"

0 commit comments

Comments
 (0)