From e924189eaf1604cbecd7ef8774307b1715503eb4 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Wed, 13 Jul 2022 23:42:39 +0200 Subject: [PATCH] remove cruft from previous example --- go-sh-manymanuals.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/go-sh-manymanuals.go b/go-sh-manymanuals.go index 5f871fe..4728a1e 100644 --- a/go-sh-manymanuals.go +++ b/go-sh-manymanuals.go @@ -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{}{} - } } }