mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-09 10:54:59 +01:00
feat: add scroll speed to config (#1968)
This commit is contained in:
@@ -50,6 +50,7 @@ type App struct {
|
||||
compactCancel context.CancelFunc
|
||||
IsLeaderSequence bool
|
||||
IsBashMode bool
|
||||
ScrollSpeed int
|
||||
}
|
||||
|
||||
func (a *App) Agent() *opencode.Agent {
|
||||
@@ -198,6 +199,7 @@ func New(
|
||||
InitialPrompt: initialPrompt,
|
||||
InitialAgent: initialAgent,
|
||||
InitialSession: initialSession,
|
||||
ScrollSpeed: int(configInfo.Tui.ScrollSpeed),
|
||||
}
|
||||
|
||||
return app, nil
|
||||
@@ -725,7 +727,7 @@ func (a *App) MarkProjectInitialized(ctx context.Context) error {
|
||||
}
|
||||
|
||||
func (a *App) CreateSession(ctx context.Context) (*opencode.Session, error) {
|
||||
session, err := a.Client.Session.New(ctx)
|
||||
session, err := a.Client.Session.New(ctx, opencode.SessionNewParams{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ type AgentModel struct {
|
||||
|
||||
type State struct {
|
||||
Theme string `toml:"theme"`
|
||||
ScrollSpeed *int `toml:"scroll_speed"`
|
||||
AgentModel map[string]AgentModel `toml:"agent_model"`
|
||||
Provider string `toml:"provider"`
|
||||
Model string `toml:"model"`
|
||||
|
||||
@@ -1194,11 +1194,7 @@ func NewMessagesComponent(app *app.App) MessagesComponent {
|
||||
vp := viewport.New()
|
||||
vp.KeyMap = viewport.KeyMap{}
|
||||
|
||||
if app.State.ScrollSpeed != nil && *app.State.ScrollSpeed > 0 {
|
||||
vp.MouseWheelDelta = *app.State.ScrollSpeed
|
||||
} else {
|
||||
vp.MouseWheelDelta = 2
|
||||
}
|
||||
vp.MouseWheelDelta = app.ScrollSpeed
|
||||
|
||||
// Default to showing tool details, hidden thinking blocks
|
||||
showToolDetails := true
|
||||
|
||||
Reference in New Issue
Block a user