Implemented g to go to the top message and shift+g/enter to go to the

bottom
This commit is contained in:
2024-12-24 17:17:59 +02:00
parent 7cf2bbd1b6
commit 534ef0df87

View File

@@ -170,6 +170,16 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
m.Scroll(m.messagesHeight / 2)
case "ctrl+d":
m.Scroll(-m.messagesHeight / 2)
case "g":
// HACK: hacky way to scroll to the top
// Also for the first time a user scrolls there will be a visual
// glitch that doesn't show the top message being selected
m.Scroll(10000) // Large numbers can slow this!!!!
case "G":
fallthrough
case "enter":
m.offset = SnapToBottom
m.index = -1
}
}