diff options
author | delthas <delthas@dille.cc> | 2021-07-13 19:26:24 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-07-13 21:38:53 +0200 |
commit | 93005741f2fa5c16bed3d7bc325c7d09a6a507da (patch) | |
tree | 2373fbf66cc6987ab7f3c6f1a1f4b0238fea9049 /ui/ui.go | |
parent | Clear 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.go | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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 } |