Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions internal/terminal/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,10 @@ func (app *App) handleLoopEvent(ctx context.Context, event tcell.Event) (shouldQ
return app.drawLatestResize(ctx, resize)
}

if delta, ok := app.scrollDeltaForEvent(event); ok {
return app.handleScrollLoopEvent(ctx, delta)
}

shouldQuit, err := app.handleEvent(ctx, event)
if err != nil {
app.addMessage(transcript.RoleCustom, err.Error())
Expand All @@ -408,6 +412,18 @@ func (app *App) handleLoopEvent(ctx context.Context, event tcell.Event) (shouldQ
return false, true
}

func (app *App) handleScrollLoopEvent(ctx context.Context, delta int) (shouldQuit, dirty bool) {
coalesced := app.coalesceScrollEvents(delta)
app.scrollTranscript(coalesced.Delta)
app.draw(ctx)

if coalesced.Pending != nil {
return app.handleLoopEvent(ctx, coalesced.Pending)
}

return false, false
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

func (app *App) drawLatestResize(ctx context.Context, resize *tcell.EventResize) (shouldQuit, dirty bool) {
pending := app.coalesceResizeEvents(resize)
if pending.Resize != nil {
Expand Down
Loading
Loading