mirror of
https://github.com/Kyren223/eko.git
synced 2026-08-28 10:21:31 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user