Skip to content

Commit

Permalink
fix right lefht
Browse files Browse the repository at this point in the history
  • Loading branch information
go-to-k committed Aug 19, 2024
1 parent f425a51 commit c910783
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions internal/io/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,29 @@ func (u *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
u.Selected[u.Cursor] = struct{}{}
}

// select all items
// select all items in filtered list
case "right":
for i := range u.Choices {
u.Selected[i] = struct{}{}
if _, ok := u.Filtered.Choices[i]; !ok {
continue
}
_, ok := u.Selected[i]
if !ok {
u.Selected[i] = struct{}{}
}
}

// clear all selected items
// clear all selected items in filtered list
case "left":
u.Selected = make(map[int]struct{})
for i := range u.Choices {
if _, ok := u.Filtered.Choices[i]; !ok {
continue
}
_, ok := u.Selected[i]
if ok {
delete(u.Selected, i)
}
}

// clear one character from the keyword
case "backspace":
Expand Down

0 comments on commit c910783

Please sign in to comment.