Ignore keys that have a multibyte length of more than 1.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
This commit is contained in:
parent
0f23ce88cb
commit
ead90f618c
|
@ -15,6 +15,7 @@ else
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Grab environment we need
|
-- Grab environment we need
|
||||||
|
local string = string
|
||||||
local assert = assert
|
local assert = assert
|
||||||
local loadstring = loadstring
|
local loadstring = loadstring
|
||||||
local ipairs = ipairs
|
local ipairs = ipairs
|
||||||
|
@ -667,8 +668,10 @@ function P.menu(args, textbox, exe_callback, completion_callback)
|
||||||
elseif key == "Right" then
|
elseif key == "Right" then
|
||||||
cur_pos = cur_pos + 1
|
cur_pos = cur_pos + 1
|
||||||
else
|
else
|
||||||
command = command:sub(1, cur_pos - 1) .. key .. command:sub(cur_pos)
|
if string.len(key) == 1 then
|
||||||
cur_pos = cur_pos + 1
|
command = command:sub(1, cur_pos - 1) .. key .. command:sub(cur_pos)
|
||||||
|
cur_pos = cur_pos + 1
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if cur_pos < 1 then
|
if cur_pos < 1 then
|
||||||
cur_pos = 1
|
cur_pos = 1
|
||||||
|
|
Loading…
Reference in New Issue