start possibly be large than b.contents

This commit is contained in:
Yasuhiro Matsumoto 2018-04-17 10:00:05 +09:00
parent c93373804d
commit db1e92033a
No known key found for this signature in database
GPG Key ID: 622DE34DC490584B

View File

@ -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)
}