mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-20 09:14:22 +01:00
(tui) tweak: add setting for scroll speed (#1288)
This commit is contained in:
@@ -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"`
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user