mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 19:25:20 -04:00
Fixed more.lua's behavior for long lines. Closes #491.
This commit is contained in:
parent
06d2e657bc
commit
d326e98714
@ -18,7 +18,8 @@ if not file then
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local function readlines(file, line, num)
|
local line = nil
|
||||||
|
local function readlines(num)
|
||||||
local w, h = component.gpu.getResolution()
|
local w, h = component.gpu.getResolution()
|
||||||
num = num or (h - 1)
|
num = num or (h - 1)
|
||||||
term.setCursorBlink(false)
|
term.setCursorBlink(false)
|
||||||
@ -39,10 +40,9 @@ local function readlines(file, line, num)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local line = nil
|
|
||||||
while true do
|
while true do
|
||||||
term.clear()
|
term.clear()
|
||||||
if not readlines(file, line) then
|
if not readlines() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
while true do
|
while true do
|
||||||
@ -56,7 +56,7 @@ while true do
|
|||||||
break
|
break
|
||||||
elseif code == keyboard.keys.enter or code == keyboard.keys.down then
|
elseif code == keyboard.keys.enter or code == keyboard.keys.down then
|
||||||
term.clearLine()
|
term.clearLine()
|
||||||
if not readlines(file, line, 1) then
|
if not readlines(1) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user