Browse Source

remove cruft from previous example

main
decentral1se 2 years ago
parent
commit
e924189eaf
No known key found for this signature in database GPG Key ID: 3789458B3D0C410
  1. 15
      go-sh-manymanuals.go

15
go-sh-manymanuals.go

@ -27,9 +27,8 @@ func handleCliFlags() {
} }
type model struct { type model struct {
manuals []string manuals []string
cursor int cursor int
selected map[int]struct{}
} }
func initialModel() model { func initialModel() model {
@ -40,8 +39,7 @@ func initialModel() model {
} }
return model{ return model{
manuals: manuals, manuals: manuals,
selected: make(map[int]struct{}),
} }
} }
@ -77,13 +75,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if m.cursor < len(m.manuals)-1 { if m.cursor < len(m.manuals)-1 {
m.cursor++ m.cursor++
} }
case "enter", " ":
_, ok := m.selected[m.cursor]
if ok {
// doing nothing!
} else {
m.selected[m.cursor] = struct{}{}
}
} }
} }

Loading…
Cancel
Save