diff options
author | delthas <delthas@dille.cc> | 2022-07-22 18:06:07 +0200 |
---|---|---|
committer | delthas <delthas@dille.cc> | 2022-07-22 18:06:07 +0200 |
commit | 05c732782558df04e47a672c727b89dbc1d2360f (patch) | |
tree | 60b04fcd907e730fec55d385b503f96dd09a9eb7 | |
parent | Scroll to the channel when changing the horizontal channel (diff) |
Fix crashing when shrinking the text to a zero width
Thanks steamyalt for the bug report.
Fixes: https://todo.sr.ht/~taiite/senpai/86
-rw-r--r-- | ui/ui.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -400,6 +400,9 @@ func (ui *UI) InputBackSearch() { func (ui *UI) Resize() { w, h := ui.screen.Size() innerWidth := w - 9 - ui.channelWidth - ui.config.NickColWidth - ui.memberWidth + if innerWidth <= 0 { + innerWidth = 1 // will break display somewhat, but this is an edge case + } ui.e.Resize(innerWidth) if ui.channelWidth == 0 { ui.bs.ResizeTimeline(innerWidth, h-3) |