Skip to content

Commit edabd47

Browse files
author
mutlusun
committed
allow a format function as argument
1 parent b00e7c6 commit edabd47

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

init.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,16 @@ end
261261
-- }}}
262262

263263
-- {{{ Get custom widget format data
264-
function vicious.getdata(myw, format, warg)
265-
return helpers.format(format, myw(format, warg))
264+
function vicious.call(myw, format, warg)
265+
local mydata = myw(format, warg)
266+
if type(format) == "string" then
267+
return helpers.format(format, mydata)
268+
elseif type(format) == "function" then
269+
return format(myw, mydata)
270+
end
266271
end
267272
-- }}}
268273

269-
270274
return vicious
271275

272276
-- }}}

0 commit comments

Comments
 (0)