From a9ed61589f508878723a2ff7850bad059369d8d4 Mon Sep 17 00:00:00 2001 From: koniu Date: Mon, 17 Nov 2008 18:25:11 +0000 Subject: [PATCH] awful.prompt: add new field 'text' to run() args Signed-off-by: koniu --- lib/awful/prompt.lua.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/awful/prompt.lua.in b/lib/awful/prompt.lua.in index ad0921fa..81af01f1 100644 --- a/lib/awful/prompt.lua.in +++ b/lib/awful/prompt.lua.in @@ -131,18 +131,19 @@ end function run(args, textbox, exe_callback, completion_callback, history_path, history_max, done_callback) local theme = beautiful.get() if not args then args = {} end - local command = "" + local command = args.text or "" local command_before_comp local cur_pos_before_comp local prettyprompt = args.prompt or "" 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_ul = args.ul_cursor + local text = args.text or "" history_check_load(history_path, history_max) local history_index = history_items(history_path) + 1 -- The cursor position - local cur_pos = 1 + local cur_pos = text:len() + 1 -- The completion element to use on completion request. local ncomp = 1 if not textbox or not exe_callback then