feat: support sublists for first available formatter
Co-authored-by: Andreas Palm <andreaspalm98@gmail.com>
This commit is contained in:
committed by
Andreas Palm
co-authored by
Andreas Palm
parent
413df4f3c6
commit
c41b19222d
@@ -7,9 +7,17 @@ local function auto_install()
|
||||
local formatters_to_install = {}
|
||||
for _, formatters in pairs(formatters_by_ft) do
|
||||
for _, formatter in pairs(formatters) do
|
||||
-- Support case where the user has defined multiple formatters
|
||||
-- for said filetype. E.g javascript = { { "prettierd", "prettier" } }
|
||||
if type(formatter) == "table" then
|
||||
for _, f in pairs(formatter) do
|
||||
formatters_to_install[f] = 1
|
||||
end
|
||||
else
|
||||
formatters_to_install[formatter] = 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for conformFormatter, _ in pairs(formatters_to_install) do
|
||||
local package = mapping.conform_to_package[conformFormatter]
|
||||
|
||||
Reference in New Issue
Block a user