From 3a44fa578eecf43c13d90c33bfcf5eda5532e4d3 Mon Sep 17 00:00:00 2001 From: Anurag Priyam Date: Sun, 4 Mar 2012 15:53:49 -0500 Subject: [PATCH] awful.prompt: remove superfluous return true from keygrabber's callback Returning true from the callback to `keygrabber` is no longer necessary to continue grabbing the keyboard. Signed-off-by: Anurag Priyam Signed-off-by: Uli Schlachter --- lib/awful/prompt.lua.in | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/awful/prompt.lua.in b/lib/awful/prompt.lua.in index d552c1a8..61f777b3 100644 --- a/lib/awful/prompt.lua.in +++ b/lib/awful/prompt.lua.in @@ -204,7 +204,7 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his capi.keygrabber.run( function (modifiers, key, event) - if event ~= "press" then return true end + if event ~= "press" then return end -- Convert index array to hash table local mod = {} for k, v in ipairs(modifiers) do mod[v] = true end @@ -221,7 +221,7 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his exec() -- We already unregistered ourselves so we don't want to return -- true, otherwise we may unregister someone else. - return true + return end -- Control cases @@ -313,7 +313,7 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his if completion_callback then if key == "Tab" or key == "ISO_Left_Tab" then if key == "ISO_Left_Tab" then - if ncomp == 1 then return true end + if ncomp == 1 then return end if ncomp == 2 then command = command_before_comp textbox:set_font(font) @@ -321,7 +321,7 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his text = command_before_comp, text_color = inv_col, cursor_color = cur_col, cursor_pos = cur_pos, cursor_ul = cur_ul, selectall = selectall, prompt = prettyprompt }) - return true + return end ncomp = ncomp - 2 @@ -336,7 +336,7 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his -- execute if only one match found and autoexec flag set if matches and #matches == 1 and args.autoexec then exec() - return true + return end else ncomp = 1 @@ -430,8 +430,6 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his cur_pos = cur_pos - 1 success = pcall(update) end - - return true end) end