fix(util.cmp): implement is_visible for blink

This commit is contained in:
Folke Lemaitre 2024-11-01 17:19:37 +01:00
parent 642434ff1f
commit b3e5c54416

View file

@ -73,7 +73,15 @@ end
function M.visible() function M.visible()
---@module 'cmp' ---@module 'cmp'
local cmp = package.loaded["cmp"] local cmp = package.loaded["cmp"]
return cmp and cmp.core.view:visible() if cmp then
return cmp.core.view:visible()
end
---@module 'blink.cmp'
local blink = package.loaded["blink.cmp"]
if blink then
return blink.windows.autocomplete.win:is_open()
end
return false
end end
-- This is a better implementation of `cmp.confirm`: -- This is a better implementation of `cmp.confirm`: