Fixed bug where if not at the bottom of the screen but index is -1 then

moving down was impossible
This commit is contained in:
2024-12-24 17:56:26 +02:00
parent d4ca377a72
commit 2d4b0df290

View File

@@ -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)