Simplify the render's write() method and it now takes a slice of lines

This commit is contained in:
Christian Rocha
2020-06-15 18:32:18 -04:00
parent 0b19d41e0a
commit f332bf2cc2
2 changed files with 17 additions and 26 deletions

View File

@@ -62,7 +62,7 @@ func (m *Model) SetContent(s string) {
m.lines = strings.Split(s, "\n")
lines := bounded(m.lines, m.YOffset, m.Height)
m.r.sync(strings.Join(lines, "\n"))
m.r.sync(lines)
}
// ViewDown moves the view down by the number of lines in the viewport.