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 <anurag08priyam@gmail.com> Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
8034e2a5d8
commit
3a44fa578e
|
@ -204,7 +204,7 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his
|
||||||
|
|
||||||
capi.keygrabber.run(
|
capi.keygrabber.run(
|
||||||
function (modifiers, key, event)
|
function (modifiers, key, event)
|
||||||
if event ~= "press" then return true end
|
if event ~= "press" then return end
|
||||||
-- Convert index array to hash table
|
-- Convert index array to hash table
|
||||||
local mod = {}
|
local mod = {}
|
||||||
for k, v in ipairs(modifiers) do mod[v] = true end
|
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()
|
exec()
|
||||||
-- We already unregistered ourselves so we don't want to return
|
-- We already unregistered ourselves so we don't want to return
|
||||||
-- true, otherwise we may unregister someone else.
|
-- true, otherwise we may unregister someone else.
|
||||||
return true
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Control cases
|
-- Control cases
|
||||||
|
@ -313,7 +313,7 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his
|
||||||
if completion_callback then
|
if completion_callback then
|
||||||
if key == "Tab" or key == "ISO_Left_Tab" then
|
if key == "Tab" or key == "ISO_Left_Tab" then
|
||||||
if 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
|
if ncomp == 2 then
|
||||||
command = command_before_comp
|
command = command_before_comp
|
||||||
textbox:set_font(font)
|
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,
|
text = command_before_comp, text_color = inv_col, cursor_color = cur_col,
|
||||||
cursor_pos = cur_pos, cursor_ul = cur_ul, selectall = selectall,
|
cursor_pos = cur_pos, cursor_ul = cur_ul, selectall = selectall,
|
||||||
prompt = prettyprompt })
|
prompt = prettyprompt })
|
||||||
return true
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
ncomp = ncomp - 2
|
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
|
-- execute if only one match found and autoexec flag set
|
||||||
if matches and #matches == 1 and args.autoexec then
|
if matches and #matches == 1 and args.autoexec then
|
||||||
exec()
|
exec()
|
||||||
return true
|
return
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
ncomp = 1
|
ncomp = 1
|
||||||
|
@ -430,8 +430,6 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his
|
||||||
cur_pos = cur_pos - 1
|
cur_pos = cur_pos - 1
|
||||||
success = pcall(update)
|
success = pcall(update)
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue