summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2022-07-22 18:06:07 +0200
committerdelthas <delthas@dille.cc>2022-07-22 18:06:07 +0200
commit05c732782558df04e47a672c727b89dbc1d2360f (patch)
tree60b04fcd907e730fec55d385b503f96dd09a9eb7
parentScroll 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.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/ui/ui.go b/ui/ui.go
index 9e4af88..5533633 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -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)