Flatten calculateBufferWithText() and gofmt
This commit is contained in:
parent
6aceb4f8d2
commit
d7d654e2ec
@ -72,14 +72,18 @@ func (msg *BaseTextMessage) calculateBufferWithText(text tstring.TString, width
|
||||
}
|
||||
|
||||
matches := boundaryPattern.FindAllStringIndex(extract.String(), -1)
|
||||
if len(matches) > 0 {
|
||||
match := matches[len(matches)-1]
|
||||
if len(match) > 1 {
|
||||
until := match[1]
|
||||
if until < len(extract) {
|
||||
extract = extract[:until]
|
||||
}
|
||||
}
|
||||
if len(matches) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
match := matches[len(matches)-1]
|
||||
if len(match) < 2 {
|
||||
continue
|
||||
}
|
||||
|
||||
until := match[1]
|
||||
if until < len(extract) {
|
||||
extract = extract[:until]
|
||||
}
|
||||
}
|
||||
msg.buffer = append(msg.buffer, extract)
|
||||
|
@ -58,7 +58,7 @@ func NewRoomList() *RoomList {
|
||||
return &RoomList{
|
||||
Box: tview.NewBox(),
|
||||
items: make(map[string][]*rooms.Room),
|
||||
tags: []string{"m.favourite", "im.vector.fake.direct", "", "m.lowpriority"},
|
||||
tags: []string{"m.favourite", "im.vector.fake.direct", "", "m.lowpriority"},
|
||||
|
||||
mainTextColor: tcell.ColorWhite,
|
||||
selectedTextColor: tcell.ColorWhite,
|
||||
@ -95,7 +95,7 @@ func (list *RoomList) CheckTag(tag string) {
|
||||
|
||||
if ok && index == -1 {
|
||||
list.tags = append(list.tags, tag)
|
||||
}/* TODO this doesn't work properly
|
||||
} /* TODO this doesn't work properly
|
||||
else if index != -1 {
|
||||
list.tags = append(list.tags[0:index], list.tags[index+1:]...)
|
||||
}*/
|
||||
|
Loading…
Reference in New Issue
Block a user