From 37ae8a31e37275a04b0f464d72a53b6a5e29dd98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Czapli=C5=84ski?= Date: Sun, 4 Mar 2018 22:32:24 +0100 Subject: fix newline handling --- up.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/up.go b/up.go index 3519d86..8083ccd 100644 --- a/up.go +++ b/up.go @@ -130,13 +130,13 @@ func (b *Buf) Draw(y0 int) { x, y := 0, y0 for len(buf) > 0 && y < h { ch, sz := utf8.DecodeRune(buf) + buf = buf[sz:] if ch == '\n' { // TODO: clear to the end of screen line x, y = 0, y+1 continue } termbox.SetCell(x, y, ch, termbox.ColorDefault, termbox.ColorDefault) - buf = buf[sz:] x++ if x > w { x, y = 0, y+1 -- cgit v1.2.3