mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
prompt: Allow each argument to be passed to the "args"
This is the first step in deprecating them. A function with so many optional arguments is just bad design. The next few commits will rewrite the documentation and deprecate the old arguments.
This commit is contained in:
parent
d513e2c4fc
commit
e5ebcc1e4c
1 changed files with 11 additions and 0 deletions
|
@ -280,6 +280,17 @@ function prompt.run(args, textbox, exe_callback, completion_callback,
|
|||
local selectall = args.selectall
|
||||
local hooks = {}
|
||||
|
||||
-- This function has already an absurd number of parameters, allow them
|
||||
-- to be set using the args to avoid a "nil, nil, nil, nil, foo" scenario
|
||||
keypressed_callback = keypressed_callback or args.keypressed_callback
|
||||
changed_callback = changed_callback or args.changed_callback
|
||||
done_callback = done_callback or args.done_callback
|
||||
history_max = history_max or args.history_max
|
||||
history_path = history_path or args.history_path
|
||||
completion_callback = completion_callback or args.completion_callback
|
||||
exe_callback = exe_callback or args.exe_callback
|
||||
textbox = textbox or args.textbox
|
||||
|
||||
search_term=nil
|
||||
|
||||
history_check_load(history_path, history_max)
|
||||
|
|
Loading…
Reference in a new issue