aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-05-22 18:43:00 +0300
committerTulir Asokan <tulir@maunium.net>2018-05-22 18:43:00 +0300
commit34359a0599269ba8e1bf535b8dd8cfda0d72e687 (patch)
tree7f75820658b648ce50d88bb65880032a7e9c4194
parentdc4e831022e6b96ca66717824db46ae94f25bbf0 (diff)
More cleanup
-rw-r--r--ui/room-list.go10
-rw-r--r--ui/tag-room-list.go8
2 files changed, 9 insertions, 9 deletions
diff --git a/ui/room-list.go b/ui/room-list.go
index 9588a55..e5b4d4e 100644
--- a/ui/room-list.go
+++ b/ui/room-list.go
@@ -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
@@ -439,7 +439,7 @@ func (list *RoomList) Draw(screen tcell.Screen) {
}
renderHeight := trl.RenderHeight()
- if y + renderHeight >= yLimit {
+ if y+renderHeight >= yLimit {
renderHeight = yLimit - y
}
trl.SetRect(x, y, width, renderHeight)
diff --git a/ui/tag-room-list.go b/ui/tag-room-list.go
index d342d59..dffe3c2 100644
--- a/ui/tag-room-list.go
+++ b/ui/tag-room-list.go
@@ -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 {