awful: fix a bug with backspace in menu

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-18 08:41:45 +02:00
parent 4617f0ba34
commit 9aa52f7b0f
1 changed files with 4 additions and 2 deletions

View File

@ -501,8 +501,10 @@ local function menu(args, textbox, exe_callback)
else
-- Typin cases
if key == "BackSpace" then
if cur_pos > 1 then
command = command:sub(1, cur_pos - 2) .. command:sub(cur_pos)
cur_pos = cur_pos - 1
end
-- That's DEL
elseif key:byte() == 127 then
command = command:sub(1, cur_pos - 1) .. command:sub(cur_pos + 1)