summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2022-09-14 15:55:17 +0200
committerdelthas <delthas@dille.cc>2022-09-14 15:55:17 +0200
commit09b45e5f0818d57d02329e88fce4053e4360d3f7 (patch)
treed01b794492839f9a96350f43fb0a5d2aaddc397d /ui
parentUse WHOX rather than WHO when available (diff)
Make the last opened channel visible in the horizontal list
When starting senpai, we jump to the last opened buffer. Offset the horizontal target list to make the buffer visible, as if scrolled to with CTRL+N. Fixes: https://todo.sr.ht/~taiite/senpai/100
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/ui.go b/ui/ui.go
index 45c3472..155601f 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -253,7 +253,11 @@ func (ui *UI) HasOverlay() bool {
}
func (ui *UI) AddBuffer(netID, netName, title string) (i int, added bool) {
- return ui.bs.Add(netID, netName, title)
+ i, added = ui.bs.Add(netID, netName, title)
+ if added {
+ ui.HorizontalBufferScrollTo()
+ }
+ return
}
func (ui *UI) RemoveBuffer(netID, title string) {