prompt: Make exe_callback optional
The menubar already bypass it using keypress listener. Having an empty callback is ugly. Fixes #1180
This commit is contained in:
parent
81f8a3085e
commit
0e1c193450
|
@ -365,7 +365,7 @@ function prompt.run(args, textbox, exe_callback, completion_callback,
|
||||||
local cur_pos = (selectall and 1) or text:wlen() + 1
|
local cur_pos = (selectall and 1) or text:wlen() + 1
|
||||||
-- The completion element to use on completion request.
|
-- The completion element to use on completion request.
|
||||||
local ncomp = 1
|
local ncomp = 1
|
||||||
if not textbox or not (exe_callback or args.hooks) then
|
if not textbox then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ function prompt.run(args, textbox, exe_callback, completion_callback,
|
||||||
textbox:set_markup("")
|
textbox:set_markup("")
|
||||||
history_add(history_path, command_to_history)
|
history_add(history_path, command_to_history)
|
||||||
keygrabber.stop(grabber)
|
keygrabber.stop(grabber)
|
||||||
cb(command)
|
if cb then cb(command) end
|
||||||
if done_callback then done_callback() end
|
if done_callback then done_callback() end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -444,7 +444,6 @@ function menubar.show(scr)
|
||||||
awful.prompt.run(setmetatable({
|
awful.prompt.run(setmetatable({
|
||||||
prompt = "Run: ",
|
prompt = "Run: ",
|
||||||
textbox = instance.prompt.widget,
|
textbox = instance.prompt.widget,
|
||||||
exe_callback = function() end,
|
|
||||||
completion_callback = awful.completion.shell,
|
completion_callback = awful.completion.shell,
|
||||||
history_path = awful.util.get_cache_dir() .. "/history_menu",
|
history_path = awful.util.get_cache_dir() .. "/history_menu",
|
||||||
done_callback = menubar.hide,
|
done_callback = menubar.hide,
|
||||||
|
|
Loading…
Reference in New Issue