Skip to content
Myr

Fix list-default to be able to exit with ctrl+c

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

authored by Kyosuke Fujimoto · committed by Christian Rocha · parent 98a8bcf · Browse files · 1 file+1 added−1 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+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:examples/list-default/main.go+1 added-1 removed
29 unmodified lines
30func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {31 switch msg := msg.(type) {32 case tea.KeyMsg:33 if msg.String() == "ctrl+c" {34 return m, nil34 return m, tea.Quit35 }36 case tea.WindowSizeMsg:37 top, right, bottom, left := docStyle.GetMargin()38 m.list.SetSize(msg.Width-left-right, msg.Height-top-bottom)
49 unmodified lines