mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-15 18:30:27 -04:00
fixed a display error when scrolling in editor lead to a horizontal scroll due to the new line being shorter than the previous one
This commit is contained in:
parent
4bc0b891f8
commit
175f0706f3
@ -46,7 +46,7 @@ local function setCursor(nbx, nby)
|
||||
scrollY = sy
|
||||
component.gpu.copy(1, 1 + dy, w, h - dy, 0, -dy)
|
||||
for by = nby - (dy - 1), nby do
|
||||
local str = text.pad(buffer[by], w)
|
||||
local str = text.pad(unicode.sub(buffer[by], 1 + scrollX), w)
|
||||
component.gpu.set(1, by - scrollY, str)
|
||||
end
|
||||
elseif ncy < 1 then
|
||||
@ -55,7 +55,7 @@ local function setCursor(nbx, nby)
|
||||
scrollY = sy
|
||||
component.gpu.copy(1, 1, w, h - dy, 0, dy)
|
||||
for by = nby, nby + (dy - 1) do
|
||||
local str = text.pad(buffer[by], w)
|
||||
local str = text.pad(unicode.sub(buffer[by], 1 + scrollX), w)
|
||||
component.gpu.set(1, by - scrollY, str)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user