fix: only attach to loaded buffer (#1)

Co-authored-by: tomasky <blueswooz@outlook.com>
This commit is contained in:
Turiiya 2023-04-14 15:22:41 +02:00 committed by GitHub
parent 5985bf4949
commit 5fe06a9190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,6 +39,7 @@ M.attach = void(function(bufnr)
if config.config.on_attach then
config.config.on_attach(bufnr)
end
if not api.nvim_buf_is_loaded(bufnr) then return end
api.nvim_buf_attach(bufnr, false, {
on_detach = on_detach,
})