diff --git a/lib/awful/prompt.lua.in b/lib/awful/prompt.lua.in index 61f777b3..5d294ae5 100644 --- a/lib/awful/prompt.lua.in +++ b/lib/awful/prompt.lua.in @@ -202,6 +202,15 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his if done_callback then done_callback() end end + -- Update textbox + local function update() + textbox:set_font(font) + textbox:set_markup(prompt_text_with_cursor{ + text = command, text_color = inv_col, cursor_color = cur_col, + cursor_pos = cur_pos, cursor_ul = cur_ul, selectall = selectall, + prompt = prettyprompt }) + end + capi.keygrabber.run( function (modifiers, key, event) if event ~= "press" then return end @@ -406,15 +415,6 @@ function run(args, textbox, exe_callback, completion_callback, history_path, his selectall = nil end - -- Update textbox - local function update() - textbox:set_font(font) - textbox:set_markup(prompt_text_with_cursor{ - text = command, text_color = inv_col, cursor_color = cur_col, - cursor_pos = cur_pos, cursor_ul = cur_ul, selectall = selectall, - prompt = prettyprompt }) - end - local success = pcall(update) while not success do -- TODO UGLY HACK TODO