Skip to content

Commit 1cfa040

Browse files
committed
re-add format parameter.
This broke custom formats in the date widget.
1 parent 750532a commit 1cfa040

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

init.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ local function update(widget, reg, disablecache)
7676
cache.time, cache.data = t, data
7777
end
7878
end
79-
79+
8080
-- Check for cached output newer than the last update
8181
local c = widget_cache[reg.wtype]
8282
if c and c.time and c.data and t < c.time+reg.timer and not disablecache then
@@ -85,14 +85,15 @@ local function update(widget, reg, disablecache)
8585
if reg.wtype.async then
8686
if not reg.lock then
8787
reg.lock = true
88-
return reg.wtype.async(reg.warg,
88+
return reg.wtype.async(reg.format,
89+
reg.warg,
8990
function(data)
9091
update_value(format_data(data), t, c)
9192
reg.lock=false
9293
end)
9394
end
9495
else
95-
return update_value(format_data(reg.wtype(nil, reg.warg)), t, c)
96+
return update_value(format_data(reg.wtype(reg.format, reg.warg)), t, c)
9697
end
9798
end
9899
end

widgets/pkg_all.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ local pkg_all = {}
1717

1818

1919
-- {{{ Packages widget type
20-
function pkg_all.async(warg, callback)
20+
function pkg_all.async(format, warg, callback)
2121
if not warg then return end
2222

2323
-- Initialize counters
@@ -44,7 +44,7 @@ function pkg_all.async(warg, callback)
4444
size = math.max(size-first, 0)
4545
return {size, lines}
4646
end
47-
47+
4848
-- Select command
4949
local _pkg = manager[warg]
5050
spawn.easy_async(_pkg.cmd, function(stdout) callback(parse(stdout, _pkg.sub)) end)
@@ -54,8 +54,8 @@ end
5454
-- {{{ Packages widget type
5555
local function worker(format, warg)
5656
local ret = nil
57-
58-
pkg_all.async(warg, function(data) ret = data end)
57+
58+
pkg_all.async(format, warg, function(data) ret = data end)
5959

6060
while ret==nil do end
6161
return ret

0 commit comments

Comments
 (0)