From 175f0706f3c71bb47e93220870f565184f1ec99c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sat, 23 Nov 2013 22:52:57 +0100 Subject: [PATCH] fixed a display error when scrolling in editor lead to a horizontal scroll due to the new line being shorter than the previous one --- assets/opencomputers/lua/rom/bin/edit.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/opencomputers/lua/rom/bin/edit.lua b/assets/opencomputers/lua/rom/bin/edit.lua index b96ae4761..d21c76b11 100644 --- a/assets/opencomputers/lua/rom/bin/edit.lua +++ b/assets/opencomputers/lua/rom/bin/edit.lua @@ -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