* 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 <[email protected]>
---
 lib/awful/completion.lua.in |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/awful/completion.lua.in b/lib/awful/completion.lua.in
index 9812557..79edf20 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
-- 
1.5.6.5


-- 
To unsubscribe, send mail to [email protected].

Reply via email to