awful: shift+tab cycles backwards through prompts

Signed-off-by: Nathan Weizenbaum <nex342@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Nathan Weizenbaum 2008-09-23 21:14:30 -07:00 committed by Julien Danjou
parent 0359bb4e4e
commit 89700eeebe
1 changed files with 11 additions and 2 deletions

View File

@ -1216,8 +1216,17 @@ function prompt.run(args, textbox, exe_callback, completion_callback, history_pa
else
if completion_callback then
-- That's tab
if key:byte() == 9 then
if ncomp == 1 then
if key:byte() == 9 or key == "ISO_Left_Tab" then
if key == "ISO_Left_Tab" then
if ncomp == 1 then return true end
if ncomp == 2 then
command = command_before_comp
textbox.text = prettyprompt .. prompt_text_with_cursor(command_before_comp, inv_col, cur_col, cur_pos)
return true
end
ncomp = ncomp - 2
elseif ncomp == 1 then
command_before_comp = command
cur_pos_before_comp = cur_pos
end