allow a format function as argument
This commit is contained in:
parent
b00e7c6cd0
commit
edabd477e2
10
init.lua
10
init.lua
|
@ -261,12 +261,16 @@ end
|
|||
-- }}}
|
||||
|
||||
-- {{{ Get custom widget format data
|
||||
function vicious.getdata(myw, format, warg)
|
||||
return helpers.format(format, myw(format, warg))
|
||||
function vicious.call(myw, format, warg)
|
||||
local mydata = myw(format, warg)
|
||||
if type(format) == "string" then
|
||||
return helpers.format(format, mydata)
|
||||
elseif type(format) == "function" then
|
||||
return format(myw, mydata)
|
||||
end
|
||||
end
|
||||
-- }}}
|
||||
|
||||
|
||||
return vicious
|
||||
|
||||
-- }}}
|
||||
|
|
Loading…
Reference in New Issue