Re-enable adding of line and supply documentation

This commit is contained in:
erroneousboat 2018-02-24 12:10:30 +01:00
parent c478b98b0f
commit f2c61c7df2

View File

@ -81,9 +81,12 @@ func (c *Chat) Buffer() termui.Buffer {
lines := []Line{}
line := Line{}
// When we encounter a newline or are at the bounds of the chat view we
// stop iterating over the cells and add the line to the line array
x := 0
for _, cell := range cells {
// When we encounter a newline we add the line to the array
if cell.Ch == '\n' {
lines = append(lines, line)
@ -105,6 +108,10 @@ func (c *Chat) Buffer() termui.Buffer {
x++
}
// Append the last line to the array when we didn't encounter any
// newlines or were at the bounds of the chat view
lines = append(lines, line)
// We will print lines bottom up, it will loop over the lines
// backwards and for every line it'll set the cell in that line.
// Offset is the number which allows us to begin printing the