feat(plugin): added support for virtual plugins. Closes #1836

This commit is contained in:
Folke Lemaitre 2024-12-06 20:28:50 +01:00
parent 3388a26417
commit ee64abc76b
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
5 changed files with 14 additions and 5 deletions

View file

@ -237,12 +237,14 @@ function M.update_state()
or plugin.cmd
plugin.lazy = lazy and true or false
end
if plugin.dir:find(Config.options.root, 1, true) == 1 then
if plugin.virtual then
plugin._.is_local = true
plugin._.installed = true -- local plugins are managed by the user
elseif plugin.dir:find(Config.options.root, 1, true) == 1 then
plugin._.installed = installed[plugin.name] ~= nil
installed[plugin.name] = nil
else
plugin._.is_local = true
plugin._.installed = true -- local plugins are managed by the user
plugin._.installed = vim.fn.isdirectory(plugin.dir) == 1
end
end