(tui) tweak: add setting for scroll speed (#1288)

This commit is contained in:
Aiden Cline
2025-07-24 16:34:59 -05:00
committed by GitHub
parent d50ae8e4d4
commit 22c9e2942b
2 changed files with 7 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ type ModeModel struct {
type State struct {
Theme string `toml:"theme"`
ScrollSpeed *int `toml:"scroll_speed"`
ModeModel map[string]ModeModel `toml:"mode_model"`
Provider string `toml:"provider"`
Model string `toml:"model"`

View File

@@ -1015,7 +1015,12 @@ func (m *messagesComponent) RedoLastMessage() (tea.Model, tea.Cmd) {
func NewMessagesComponent(app *app.App) MessagesComponent {
vp := viewport.New()
vp.KeyMap = viewport.KeyMap{}
vp.MouseWheelDelta = 4
if app.State.ScrollSpeed != nil && *app.State.ScrollSpeed > 0 {
vp.MouseWheelDelta = *app.State.ScrollSpeed
} else {
vp.MouseWheelDelta = 4
}
return &messagesComponent{
app: app,