From 93005741f2fa5c16bed3d7bc325c7d09a6a507da Mon Sep 17 00:00:00 2001 From: delthas Date: Tue, 13 Jul 2021 19:26:24 +0200 Subject: Switch to the buffer of a new user-requested channel join --- ui/ui.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ui/ui.go') 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 } -- cgit v1.2.3