Skip to content
Myr

Pull batch processing into the internal message switch

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent 4fbe50a · Browse files · 1 file+8 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−10 removed

  • other:+8 added−10 removed

1 file+8 added−10 removed

modified:tea.go+8 added-10 removed
420 unmodified lines
421 close(done)422 return err423 case msg := <-msgs:424425 // Handle special messages426 switch msg.(type) {425 // Handle special internal messages426 switch msg := msg.(type) {427 case quitMsg:428 p.ExitAltScreen()429 p.DisableMouseCellMotion()430 p.DisableMouseAllMotion()431 p.renderer.stop()432 close(done)433 return nil434435 case batchMsg:436 for _, cmd := range msg {437 cmds <- cmd438 }439 continue440441 case enterAltScreenMsg:442 p.EnterAltScreen()443444 case exitAltScreenMsg:
12 unmodified lines
457 case hideCursorMsg:458 hideCursor(p.output)459 }460455 // Process batch commands456 if batchedCmds, ok := msg.(batchMsg); ok {457 for _, cmd := range batchedCmds {458 cmds <- cmd459 }460 continue461 }462461 // Process internal messages for the renderer462 if r, ok := p.renderer.(*standardRenderer); ok {463 r.handleMessages(msg)464 }
89 unmodified lines