awful.prompt: add new field 'text' to run() args

Signed-off-by: koniu <gkusnierz@gmail.com>
This commit is contained in:
koniu 2008-11-17 18:25:11 +00:00 committed by Julien Danjou
parent c63f16b233
commit a9ed61589f
1 changed files with 3 additions and 2 deletions

View File

@ -131,18 +131,19 @@ end
function run(args, textbox, exe_callback, completion_callback, history_path, history_max, done_callback) function run(args, textbox, exe_callback, completion_callback, history_path, history_max, done_callback)
local theme = beautiful.get() local theme = beautiful.get()
if not args then args = {} end if not args then args = {} end
local command = "" local command = args.text or ""
local command_before_comp local command_before_comp
local cur_pos_before_comp local cur_pos_before_comp
local prettyprompt = args.prompt or "" local prettyprompt = args.prompt or ""
local inv_col = args.fg_cursor or theme.fg_focus or "black" local inv_col = args.fg_cursor or theme.fg_focus or "black"
local cur_col = args.bg_cursor or theme.bg_focus or "white" local cur_col = args.bg_cursor or theme.bg_focus or "white"
local cur_ul = args.ul_cursor local cur_ul = args.ul_cursor
local text = args.text or ""
history_check_load(history_path, history_max) history_check_load(history_path, history_max)
local history_index = history_items(history_path) + 1 local history_index = history_items(history_path) + 1
-- The cursor position -- The cursor position
local cur_pos = 1 local cur_pos = text:len() + 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 then if not textbox or not exe_callback then