summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-12-24 17:56:26 +0200
committerKyren223 <Kyren223@proton.me>2024-12-24 17:56:26 +0200
commit2d4b0df290a17b9f109443be177f2bed32a64641 (patch)
treeaa3e7772b5293d1b929c2ff516f53c5ea5969d2c /internal
parentd4ca377a72a04c814d7241e8937ce3cfdca7f00c (diff)
Fixed bug where if not at the bottom of the screen but index is -1 then
moving down was impossible
Diffstat (limited to 'internal')
-rw-r--r--internal/client/ui/core/chat/chat.go10
1 files 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)