mirror of
https://github.com/taigrr/gico.git
synced 2026-04-01 18:58:59 -07:00
update the appropriate lists on keyenter/space
This commit is contained in:
@@ -57,10 +57,28 @@ func (m Settings) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
switch m.cursor {
|
switch m.cursor {
|
||||||
case authors:
|
case authors:
|
||||||
var cmd tea.Cmd
|
var cmd tea.Cmd
|
||||||
|
switch msg := msg.(type) {
|
||||||
|
case tea.KeyMsg:
|
||||||
|
switch msg.String() {
|
||||||
|
case "space", "enter":
|
||||||
|
selected := m.AuthorList.Cursor()
|
||||||
|
m.AllAuthors[selected].selected = !m.AllAuthors[selected].selected
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.SelectedAuthors = m.AllAuthors.GetSelected()
|
||||||
m.AuthorList, cmd = m.AuthorList.Update(msg)
|
m.AuthorList, cmd = m.AuthorList.Update(msg)
|
||||||
return m, cmd
|
return m, cmd
|
||||||
case repos:
|
case repos:
|
||||||
var cmd tea.Cmd
|
var cmd tea.Cmd
|
||||||
|
switch msg := msg.(type) {
|
||||||
|
case tea.KeyMsg:
|
||||||
|
switch msg.String() {
|
||||||
|
case "space", "enter":
|
||||||
|
selected := m.RepoList.Cursor()
|
||||||
|
m.AllRepos[selected].selected = !m.AllRepos[selected].selected
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m.SelectedRepos = m.AllRepos.GetSelected()
|
||||||
m.RepoList, cmd = m.RepoList.Update(msg)
|
m.RepoList, cmd = m.RepoList.Update(msg)
|
||||||
return m, cmd
|
return m, cmd
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user