diff options
author | Nomeji <nomeji@saucisseroyale.cc> | 2022-10-13 17:52:36 +0200 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-10-13 17:53:30 +0200 |
commit | 0bef7424e21f24310f74a90f1f61874ea3bfeec6 (patch) | |
tree | cbed189b6a4d7e1fbdb91e1b62966e2730de5158 | |
parent | Fix crashing on ISUPPORT PREFIX= (diff) |
Scroll to buffer on zoom
-rw-r--r-- | ui/buffers.go | 4 | ||||
-rw-r--r-- | ui/ui.go | 1 |
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 @@ -424,6 +424,7 @@ func (ui *UI) Resize() { } else { ui.bs.ResizeTimeline(innerWidth, h-2, textWidth) } + ui.HorizontalBufferScrollTo() ui.screen.Sync() } |