Skip to content
Myr

Update glamour example per viewport API update

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 1ca2b1c · Browse files · 1 file+3 added−3 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+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:examples/glamour/main.go+3 added-3 removed
53 unmodified lines
54 viewport viewport.Model55}5657func newExample() (*example, error) {58 vp := viewport.Model{Width: 78, Height: 20}58 vp := viewport.NewModel(78, 20)5960 renderer, err := glamour.NewTermRenderer(glamour.WithStylePath("notty"))61 if err != nil {62 return nil, err
25 unmodified lines
88 switch msg.String() {89 case "q", "ctrl+c", "esc":90 return e, tea.Quit91 default:92 vp, cmd := e.viewport.Update(msg)93 e.viewport = vp92 newModel, cmd := e.viewport.Update(msg)93 e.viewport = newModel.(viewport.Model)94 return e, cmd95 }96 default:97 return e, nil
23 unmodified lines