close menus when resizing windows

This commit is contained in:
Eduardo Bart
2012-01-04 23:55:07 -02:00
parent 30ce5e2ba9
commit 24c1f05d66
3 changed files with 40 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ function table.copy(t)
return res
end
function table.selective_copy(t, keys)
function table.selectivecopy(t, keys)
local res = { }
for i,v in ipairs(keys) do
res[v] = t[v]
@@ -32,3 +32,21 @@ function table.merge(t, src)
t[k] = v
end
end
function table.find(t, value)
for k,v in pairs(t) do
if v == value then return k end
end
end
function table.removevalue(t, value)
local queue = {}
for k,v in pairs(t) do
if v == value then
table.insert(queue, k)
end
end
for i,v in pairs(queue) do
table.remove(t, i)
end
end