BugFix: Fix function component not working (#175)
When the provided function takes an optional argument the previous implementation causes error.
This commit is contained in:
parent
4f53d053a1
commit
aa844a9555
|
@ -1,9 +1,8 @@
|
||||||
local FunctionComponent = require('lualine.component'):new()
|
local FunctionComponent = require('lualine.component'):new()
|
||||||
|
|
||||||
FunctionComponent.new = function(self, options, child)
|
FunctionComponent.update_status = function(self)
|
||||||
local new_instence = self._parent:new(options, child or FunctionComponent)
|
-- 1st element in options table is the function provided by config
|
||||||
new_instence.update_status = options[1]
|
return self.options[1]()
|
||||||
return new_instence
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return FunctionComponent
|
return FunctionComponent
|
||||||
|
|
Loading…
Reference in New Issue