From 7a837bd2a6ff441ffde1d9cd7b7c71e39165e23b Mon Sep 17 00:00:00 2001 From: TsT Date: Tue, 6 Mar 2012 00:07:41 +0100 Subject: [PATCH] table.foreach is deprecated: now use for + pairs Signed-off-by: Uli Schlachter --- lib/awful/completion.lua.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/awful/completion.lua.in b/lib/awful/completion.lua.in index e964b53c5..8fec2c457 100644 --- a/lib/awful/completion.lua.in +++ b/lib/awful/completion.lua.in @@ -11,6 +11,7 @@ local os = os local table = table local math = math local print = print +local pairs = pairs local util = require("awful.util") --- Completion module. @@ -172,11 +173,11 @@ function generic(text, cur_pos, ncomp, keywords) -- Filter out only keywords starting with text local matches = {} - table.foreach(keywords, function(_, x) - if x:sub(1 , #text) == text then + for _, x in pairs(keywords) do + if x:sub(1, #text) == text then table.insert(matches, x) end - end) + end -- if there are no matches just leave out with the current text and position if #matches == 0 then