Skip to content

Commit

Permalink
Fix: check if a plugin given as a requirement is a single-specificati…
Browse files Browse the repository at this point in the history
…on table (#1041)

* Fix: check if a plugin given as a requirement is a single-specification table

* Update lua/packer.lua

Add @akinsho's edge case check for {{spec...}}

Co-authored-by: Akin <22454918+akinsho@users.noreply.github.com>

Co-authored-by: Akin <22454918+akinsho@users.noreply.github.com>
  • Loading branch information
wbthomason and akinsho authored Sep 2, 2022
1 parent ec327f5 commit c11416c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lua/packer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ manage = function(plugin_data)
plugins[plugin_spec.short_name].url = util.remove_ending_git_url(plugin_spec.url)

if plugin_spec.requires and config.ensure_dependencies then
if type(plugin_spec.requires) == 'string' then
-- Handle single plugins given as strings or single plugin specs given as tables
if
type(plugin_spec.requires) == 'string'
or (type(plugin_spec.requires) == 'table' and not vim.tbl_islist(plugin_spec.requires) and #plugin_spec.requires == 1)
then
plugin_spec.requires = { plugin_spec.requires }
end
for _, req in ipairs(plugin_spec.requires) do
Expand Down

0 comments on commit c11416c

Please sign in to comment.