More cleanup

This commit is contained in:
Tulir Asokan 2018-05-22 18:43:00 +03:00
parent dc4e831022
commit 34359a0599
2 changed files with 9 additions and 9 deletions

View File

@ -330,7 +330,7 @@ func (list *RoomList) index(tag string, room *rooms.Room) int {
localIndex = trl.Length() - 1 - localIndex
// Tag header
localIndex += 1
localIndex++
if tagIndex > 0 {
for i := 0; i < tagIndex; i++ {
@ -359,7 +359,7 @@ func (list *RoomList) HandleClick(column, line int, mod bool) (string, *rooms.Ro
trl := list.items[tag]
if line--; line == -1 {
trl.ToggleCollapse()
return "", nil
break
}
if trl.IsCollapsed() {
@ -367,7 +367,7 @@ func (list *RoomList) HandleClick(column, line int, mod bool) (string, *rooms.Ro
}
if line < 0 {
return "", nil
break
} else if line < trl.Length() {
return tag, trl.Visible()[trl.Length()-1-line].Room
}
@ -392,7 +392,7 @@ func (list *RoomList) HandleClick(column, line int, mod bool) (string, *rooms.Ro
if trl.maxShown < 10 {
trl.maxShown = 10
}
return "", nil
break
}
}
// Tag footer

View File

@ -17,13 +17,13 @@
package ui
import (
"maunium.net/go/gomuks/matrix/rooms"
"strings"
"fmt"
"maunium.net/go/tcell"
"strconv"
"maunium.net/go/gomuks/matrix/rooms"
"maunium.net/go/gomuks/ui/widget"
"maunium.net/go/tcell"
"maunium.net/go/tview"
"strconv"
"strings"
)
type OrderedRoom struct {