Ignore keys that have a multibyte length of more than 1.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
This commit is contained in:
Pierre Habouzit 2008-06-25 11:45:57 +02:00
parent 0f23ce88cb
commit ead90f618c
1 changed files with 5 additions and 2 deletions

View File

@ -15,6 +15,7 @@ else
end
-- Grab environment we need
local string = string
local assert = assert
local loadstring = loadstring
local ipairs = ipairs
@ -667,8 +668,10 @@ function P.menu(args, textbox, exe_callback, completion_callback)
elseif key == "Right" then
cur_pos = cur_pos + 1
else
command = command:sub(1, cur_pos - 1) .. key .. command:sub(cur_pos)
cur_pos = cur_pos + 1
if string.len(key) == 1 then
command = command:sub(1, cur_pos - 1) .. key .. command:sub(cur_pos)
cur_pos = cur_pos + 1
end
end
if cur_pos < 1 then
cur_pos = 1