Everything is no longer broken

This commit is contained in:
Tulir Asokan
2018-04-24 16:51:40 +03:00
parent fcd9a932cb
commit e64df67ec3
10 changed files with 77 additions and 40 deletions

View File

@ -73,7 +73,13 @@ func (msg *BaseTextMessage) calculateBufferWithText(text tstring.TString, width
matches := boundaryPattern.FindAllStringIndex(extract.String(), -1)
if len(matches) > 0 {
extract = extract[:matches[len(matches)-1][1]]
match := matches[len(matches)-1]
if len(match) > 1 {
until := match[1]
if until < len(extract) {
extract = extract[:until]
}
}
}
}
msg.buffer = append(msg.buffer, extract)