diff --git a/libs/window.lua b/libs/window.lua index 6672c5b..a25aabc 100644 --- a/libs/window.lua +++ b/libs/window.lua @@ -253,7 +253,8 @@ function lib.create(name, w, h, x, y, do_not_add) for xi = 1, t.w do init_col(xi) for yy = 1, t.h - n do - local dst, src = t.buffer[xi][yy], t.buffer[xi][yy + n] + if not t.buffer[xi][yy] then t.buffer[xi][yy] = { char = " ", tc = t.textColor, bc = t.bgColor } end + local dst, src = t.buffer[xi][yy], (t.buffer[xi][yy + n] or { char = " ", tc = t.textColor, bc = t.bgColor }) dst.char, dst.tc, dst.bc = src.char, src.tc, src.bc end for yy = t.h - n + 1, t.h do