Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
fix: make table providers properly return icons
Browse files Browse the repository at this point in the history
  • Loading branch information
famiu committed Sep 26, 2021
1 parent 4600327 commit c9d5ef7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lua/feline/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,18 +217,16 @@ end
-- Parse component provider
local function parse_provider(provider, winid, component)
local icon
local opts = {}

-- If provider is a string and its name matches the name of a registered provider, use it
if type(provider) == "string" and providers[provider] then
provider, icon = providers[provider](winid, component, opts)
provider, icon = providers[provider](winid, component, {})
-- If provider is a function, just evaluate it normally
elseif type(provider) == "function" then
provider, icon = provider(winid, component)
-- If provider is a table, get the provider name and opts and evaluate the provider
elseif type(provider) == "table" then
opts = provider.opts
provider = providers[provider.name](winid, component, opts)
provider, icon = providers[provider.name](winid, component, provider.opts or {})
end

return provider, icon
Expand Down

0 comments on commit c9d5ef7

Please sign in to comment.