mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 18:55:03 -04:00
Move hint check to onKeyDown
This commit is contained in:
parent
8eeed80f0c
commit
4f91f00b55
@ -248,15 +248,13 @@ function term.read(history, dobreak, hint)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function tab()
|
local function tab()
|
||||||
if hint then
|
local after = hint(line())
|
||||||
local after = hint(line())
|
if type(after) == "string" then
|
||||||
if type(after) == "string" then
|
local _, cby = getCursor()
|
||||||
local _, cby = getCursor()
|
history[cby] = after
|
||||||
history[cby] = after
|
|
||||||
end
|
|
||||||
redraw() --hint might have printed sth
|
|
||||||
ende()
|
|
||||||
end
|
end
|
||||||
|
redraw() --hint might have printed sth
|
||||||
|
ende()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function onKeyDown(char, code)
|
local function onKeyDown(char, code)
|
||||||
@ -277,7 +275,7 @@ function term.read(history, dobreak, hint)
|
|||||||
up()
|
up()
|
||||||
elseif code == keyboard.keys.down then
|
elseif code == keyboard.keys.down then
|
||||||
down()
|
down()
|
||||||
elseif code == keyboard.keys.tab then
|
elseif code == keyboard.keys.tab and hint then
|
||||||
tab()
|
tab()
|
||||||
elseif code == keyboard.keys.enter then
|
elseif code == keyboard.keys.enter then
|
||||||
local cbx, cby = getCursor()
|
local cbx, cby = getCursor()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user