summaryrefslogtreecommitdiff
path: root/ui/ui.go
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2021-07-13 19:26:24 +0200
committerHubert Hirtz <hubert@hirtz.pm>2021-07-13 21:38:53 +0200
commit93005741f2fa5c16bed3d7bc325c7d09a6a507da (patch)
tree2373fbf66cc6987ab7f3c6f1a1f4b0238fea9049 /ui/ui.go
parentClear the input on CTRL+C instead of quitting (diff)
Switch to the buffer of a new user-requested channel join
Diffstat (limited to '')
-rw-r--r--ui/ui.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/ui.go b/ui/ui.go
index 4ced9f0..6fe0798 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -128,8 +128,8 @@ func (ui *UI) IsAtTop() bool {
return ui.bs.IsAtTop()
}
-func (ui *UI) AddBuffer(title string) {
- _ = ui.bs.Add(title)
+func (ui *UI) AddBuffer(title string) int {
+ return ui.bs.Add(title)
}
func (ui *UI) RemoveBuffer(title string) {
@@ -156,6 +156,14 @@ func (ui *UI) JumpBuffer(sub string) bool {
return false
}
+func (ui *UI) JumpBufferIndex(i int) bool {
+ if i >= 0 && i < len(ui.bs.list) {
+ ui.bs.To(i)
+ return true
+ }
+ return false
+}
+
func (ui *UI) SetStatus(status string) {
ui.status = status
}