From db1e92033a15838a889d14eb496664f065c88cf0 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Tue, 17 Apr 2018 10:00:05 +0900 Subject: [PATCH] start possibly be large than b.contents --- gui/buffer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gui/buffer.go b/gui/buffer.go index 5cb2918..75d8e68 100644 --- a/gui/buffer.go +++ b/gui/buffer.go @@ -799,6 +799,9 @@ func (b *Buffer) renderAt(ctx *strife.Renderer, rx int, ry int) { start := b.cam.y upper := b.cam.y + visibleLines + if start > len(b.contents) { + start = len(b.contents) + } if upper > len(b.contents) { upper = len(b.contents) }