From 8fb0ba2417a8ce834fed2efe1024b1a8c6a67249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Gross?= Date: Thu, 18 Dec 2008 12:18:07 +0000 Subject: [PATCH] awful.completion: remove keywords global variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * move keywords global variable to generic() last parameter. This prevents from having table clash. Please udate you configuration according this feature in your awful.prompt.run() calls. If keywords parameter is missing then no completion would be done. Before: awful.completion.keywords = kw awful.prompt.run( [ ... ], function(t, p, n) return awful.completion.generic(t, p, n) end, [ ... ] ) Now: awful.prompt.run( [ ... ], function(t, p, n) return awful.completion.generic(t, p, n, kw) end, [ ... ] ) Signed-off-by: Sébastien Gross Signed-off-by: Julien Danjou --- lib/awful/completion.lua.in | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/awful/completion.lua.in b/lib/awful/completion.lua.in index 981255791..79edf2020 100644 --- a/lib/awful/completion.lua.in +++ b/lib/awful/completion.lua.in @@ -18,10 +18,6 @@ module("awful.completion") local bashcomp_funcs = {} local bashcomp_src = "/etc/bash_completion" ---- keywords table use for the generic completion --- should not be local -keywords = {} - --- Enable programmable bash completion in awful.completion.bash at the price of -- a slight overhead -- @param src The bash completion source file, /etc/bash_completion by default. @@ -130,8 +126,9 @@ end -- @param text The current text the user had typed yet. -- @param cur_pos The current cursor position. -- @param ncomp The number of yet requested completion using current text. +-- @param keywords The keywords table uised for completion. -- @return The new match and the new cursor position. -function generic(text, cur_pos, ncomp) +function generic(text, cur_pos, ncomp, keywords) -- The keywords table may be empty if #keywords == 0 then return text, #text + 1