From 8fd801a6f4256ef4cb4cb1f69ff0fab87deef93c Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 6 Mar 2016 11:34:44 +0100 Subject: [PATCH] awful.util.get_rectangle_in_direction(): Use pairs This code works just fine with non-integer table keys. Also, this is used by awful.screen.focus_bydirection() and thus will be used with screen objects instead of screen indicies when we get rid of screen indicies. Signed-off-by: Uli Schlachter --- lib/awful/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/awful/util.lua b/lib/awful/util.lua index cd61fea5c..f1c3feff6 100644 --- a/lib/awful/util.lua +++ b/lib/awful/util.lua @@ -362,7 +362,7 @@ function util.get_rectangle_in_direction(dir, recttbl, cur) local target = nil -- We check each object - for i, rect in ipairs(recttbl) do + for i, rect in pairs(recttbl) do -- Check geometry to see if object is located in the right direction. if is_in_direction(dir, cur, rect) then -- Calculate distance between current and checked object.