summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNomeji <nomeji@saucisseroyale.cc>2022-10-13 17:52:36 +0200
committerdelthas <delthas@dille.cc>2022-10-13 17:53:30 +0200
commit0bef7424e21f24310f74a90f1f61874ea3bfeec6 (patch)
treecbed189b6a4d7e1fbdb91e1b62966e2730de5158
parentFix crashing on ISUPPORT PREFIX= (diff)
Scroll to buffer on zoom
-rw-r--r--ui/buffers.go4
-rw-r--r--ui/ui.go1
2 files changed, 5 insertions, 0 deletions
diff --git a/ui/buffers.go b/ui/buffers.go
index 75948af..0e398de 100644
--- a/ui/buffers.go
+++ b/ui/buffers.go
@@ -632,6 +632,10 @@ func (bs *BufferList) HorizontalBufferOffset(x int, offset int) int {
}
func (bs *BufferList) GetLeftMost(screenWidth int) int {
+ if len(bs.list) == 0 {
+ return 0
+ }
+
width := 0
var leftMost int
diff --git a/ui/ui.go b/ui/ui.go
index 155601f..1a0da91 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -424,6 +424,7 @@ func (ui *UI) Resize() {
} else {
ui.bs.ResizeTimeline(innerWidth, h-2, textWidth)
}
+ ui.HorizontalBufferScrollTo()
ui.screen.Sync()
}