From 2d4b0df290a17b9f109443be177f2bed32a64641 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Tue, 24 Dec 2024 17:56:26 +0200 Subject: [PATCH] Fixed bug where if not at the bottom of the screen but index is -1 then moving down was impossible --- internal/client/ui/core/chat/chat.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/internal/client/ui/core/chat/chat.go b/internal/client/ui/core/chat/chat.go index 0d8f22c..286272e 100644 --- a/internal/client/ui/core/chat/chat.go +++ b/internal/client/ui/core/chat/chat.go @@ -594,18 +594,14 @@ func (m *Model) renderHeader(message data.Message, selected bool) []byte { } func (m *Model) Scroll(amount int) { - log.Println("SCROLL", m.index, amount) if m.index == -1 { - if amount <= 0 { - return - } - if m.offset != SnapToBottom { m.index = m.offset - m.messagesHeight - } else { + amount-- + } else if amount > 0 { m.index = 1 // Skip bottom blank line + amount-- } - amount-- } m.index = max(-1, m.index+amount)