forked from varia/go-sh-manymanuals
remove cruft from previous example
This commit is contained in:
parent
dc09d8c1a5
commit
e924189eaf
@ -27,9 +27,8 @@ func handleCliFlags() {
|
||||
}
|
||||
|
||||
type model struct {
|
||||
manuals []string
|
||||
cursor int
|
||||
selected map[int]struct{}
|
||||
manuals []string
|
||||
cursor int
|
||||
}
|
||||
|
||||
func initialModel() model {
|
||||
@ -40,8 +39,7 @@ func initialModel() model {
|
||||
}
|
||||
|
||||
return model{
|
||||
manuals: manuals,
|
||||
selected: make(map[int]struct{}),
|
||||
manuals: manuals,
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,13 +75,6 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
if m.cursor < len(m.manuals)-1 {
|
||||
m.cursor++
|
||||
}
|
||||
case "enter", " ":
|
||||
_, ok := m.selected[m.cursor]
|
||||
if ok {
|
||||
// doing nothing!
|
||||
} else {
|
||||
m.selected[m.cursor] = struct{}{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user