commit 05c7327

delthas  ·  2022-07-22 16:06:07 +0000 UTC
parent b75cb83
Fix crashing when shrinking the text to a zero width

Thanks steamyalt for the bug report.

Fixes: https://todo.sr.ht/~taiite/senpai/86
1 files changed,  +3, -0
+3, -0
 1@@ -400,6 +400,9 @@ func (ui *UI) InputBackSearch() {
 2 func (ui *UI) Resize() {
 3 	w, h := ui.screen.Size()
 4 	innerWidth := w - 9 - ui.channelWidth - ui.config.NickColWidth - ui.memberWidth
 5+	if innerWidth <= 0 {
 6+		innerWidth = 1 // will break display somewhat, but this is an edge case
 7+	}
 8 	ui.e.Resize(innerWidth)
 9 	if ui.channelWidth == 0 {
10 		ui.bs.ResizeTimeline(innerWidth, h-3)