libs: fix callback call and untab
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
36cf917890
commit
0348b0566e
|
@ -10,7 +10,6 @@ local assert = assert
|
||||||
local loadstring = loadstring
|
local loadstring = loadstring
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
local pairs = pairs
|
local pairs = pairs
|
||||||
local unpack = unpack
|
|
||||||
local os = os
|
local os = os
|
||||||
local io = io
|
local io = io
|
||||||
local math = math
|
local math = math
|
||||||
|
@ -569,7 +568,7 @@ end
|
||||||
-- @param name Hook name.
|
-- @param name Hook name.
|
||||||
function hooks.user.call(name, ...)
|
function hooks.user.call(name, ...)
|
||||||
for name, callback in pairs(hooks[name].callbacks) do
|
for name, callback in pairs(hooks[name].callbacks) do
|
||||||
callback(unpack(args))
|
callback(...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@ function untab(cl)
|
||||||
local cindex = findkey(tabbed[tabindex][2], c)
|
local cindex = findkey(tabbed[tabindex][2], c)
|
||||||
|
|
||||||
if tabbed[tabindex][1] == c then
|
if tabbed[tabindex][1] == c then
|
||||||
display(tabindex, P.next(tabindex, c))
|
display(tabindex, next(tabindex, c))
|
||||||
end
|
end
|
||||||
|
|
||||||
table.remove(tabbed[tabindex][2], cindex)
|
table.remove(tabbed[tabindex][2], cindex)
|
||||||
|
|
Loading…
Reference in New Issue