fix(cmp): visible

This commit is contained in:
Folke Lemaitre 2024-06-16 15:30:44 +02:00
parent e2972f0cca
commit 57ef349910
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -71,8 +71,9 @@ function M.add_missing_snippet_docs(window)
end end
function M.visible() function M.visible()
local ok, cmp = pcall(require, "cmp") ---@module 'cmp'
return ok and cmp.core.view:visible() local cmp = package.loaded["cmp"]
return cmp and cmp.core.view:visible()
end end
-- This is a better implementation of `cmp.confirm`: -- This is a better implementation of `cmp.confirm`: