expose list.FilterMachesMsg (#77)

This commit is contained in:
Jonah 2022-01-11 09:28:44 -08:00 committed by GitHub
parent c426cb580b
commit 7a728eae31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,7 @@ func (f filteredItems) matches() [][]int {
return agg
}
type filterMatchesMsg []filteredItem
type FilterMatchesMsg []filteredItem
type statusMessageTimeoutMsg struct{}
@ -694,7 +694,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
return m, tea.Quit
}
case filterMatchesMsg:
case FilterMatchesMsg:
m.filteredItems = filteredItems(msg)
return m, nil
@ -1125,7 +1125,7 @@ func (m Model) spinnerView() string {
func filterItems(m Model) tea.Cmd {
return func() tea.Msg {
if m.FilterInput.Value() == "" || m.filterState == Unfiltered {
return filterMatchesMsg(m.itemsAsFilterItems()) // return nothing
return FilterMatchesMsg(m.itemsAsFilterItems()) // return nothing
}
targets := []string{}
@ -1146,7 +1146,7 @@ func filterItems(m Model) tea.Cmd {
})
}
return filterMatchesMsg(filterMatches)
return FilterMatchesMsg(filterMatches)
}
}