Skip to content

Commit

Permalink
allow a format function as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mutlusun committed Feb 27, 2017
1 parent b00e7c6 commit edabd47
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions init.lua
Expand Up @@ -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

-- }}}

0 comments on commit edabd47

Please sign in to comment.