Make awful.layout.inc() accept a screen number

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Poggles 2013-02-19 03:53:58 +00:00 committed by Uli Schlachter
parent f859131bf3
commit bd05219a72
1 changed files with 5 additions and 4 deletions

View File

@ -37,10 +37,11 @@ end
--- Change the layout of the current tag. --- Change the layout of the current tag.
-- @param layouts A table of layouts. -- @param layouts A table of layouts.
-- @param i Relative index. -- @param i Relative index.
function layout.inc(layouts, i) -- @param s The screen number.
local t = tag.selected() function layout.inc(layouts, i, s)
local t = tag.selected(s)
if t then if t then
local curlayout = layout.get() local curlayout = layout.get(s)
local curindex local curindex
local rev_layouts = {} local rev_layouts = {}
for k, v in ipairs(layouts) do for k, v in ipairs(layouts) do
@ -51,7 +52,7 @@ function layout.inc(layouts, i)
end end
if curindex then if curindex then
local newindex = util.cycle(#layouts, curindex + i) local newindex = util.cycle(#layouts, curindex + i)
layout.set(layouts[newindex]) layout.set(layouts[newindex], t)
end end
end end
end end