Add source:is_available API

This commit is contained in:
hrsh7th
2021-08-11 21:37:55 +09:00
parent 5200927346
commit ab616ffe88
3 changed files with 17 additions and 1 deletions

View File

@@ -59,7 +59,9 @@ core.get_sources = function(statuses)
for _, s in pairs(core.sources) do
if c.name == s.name then
if not statuses or vim.tbl_contains(statuses, s.status) then
table.insert(sources, s)
if s:is_available() then
table.insert(sources, s)
end
end
end
end