feat(providers): Support independent configs for each provider to handle

Closes #58
This commit is contained in:
hedy
2024-03-16 08:12:50 +08:00
parent 8c6b11e4c2
commit b64c0c66d4
7 changed files with 39 additions and 6 deletions

View File

@@ -3,6 +3,8 @@ local import_prefix = 'outline/providers/'
---@return outline.Provider?, table?
function M.find_provider()
local configs = require('outline.config').o.providers
if not M.providers then
M.providers = vim.tbl_map(function(p)
return import_prefix .. p
@@ -11,7 +13,7 @@ function M.find_provider()
for _, path in ipairs(M.providers) do
local provider = require(path)
local ok, info = provider.supports_buffer(0)
local ok, info = provider.supports_buffer(0, configs[provider.name])
if ok then
return provider, info
end