X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/7b6d0a81e0f3c8e33b1b76d5ecbc5bdb25a87249..7b8d8e8f4b57bd51fd6d0f0d926b821f06b0e1f0:/view_layout.go?ds=inline diff --git a/view_layout.go b/view_layout.go index 0d4e756..3db2f01 100644 --- a/view_layout.go +++ b/view_layout.go @@ -59,8 +59,11 @@ type ViewLayout struct { // earlier messages up to the first one whose text differs, and puts the rest // of the lines into one new message. func (l *ViewLayout) Split(lines []string) ([]string, error) { - var texts []string - var kept []ViewLayoutMessage + var ( + texts []string + kept []ViewLayoutMessage + ) + start := 0 for _, message := range l.Messages { if start+message.Lines > len(lines) {