fix: ensure accurate detection of plugin installation across lazy, packer, and vim-plug
This commit is contained in:
@@ -128,7 +128,23 @@ end
|
|||||||
|
|
||||||
-- Check if plugin is installed
|
-- Check if plugin is installed
|
||||||
function M.is_installed(plugin)
|
function M.is_installed(plugin)
|
||||||
|
-- Check for lazy.nvim
|
||||||
|
local lazy_installed = pcall(require, "lazy")
|
||||||
|
if lazy_installed then
|
||||||
return require("lazy.core.config").plugins[plugin] ~= nil
|
return require("lazy.core.config").plugins[plugin] ~= nil
|
||||||
|
end
|
||||||
|
-- Check for packer.nvim
|
||||||
|
local packer_installed = pcall(require, "packer_plugins")
|
||||||
|
if packer_installed then
|
||||||
|
---@diagnostic disable-next-line: undefined-field
|
||||||
|
return _G.packer_plugins and _G.packer_plugins[plugin] ~= nil
|
||||||
|
end
|
||||||
|
-- Check for vim-plug
|
||||||
|
if vim.fn.exists("g:plugs") == 1 then
|
||||||
|
return vim.g.plugs[plugin] ~= nil
|
||||||
|
end
|
||||||
|
-- Plugin not found
|
||||||
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Function to convert RGB to hexadecimal
|
-- Function to convert RGB to hexadecimal
|
||||||
|
|||||||
Reference in New Issue
Block a user