mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-03-20 07:33:44 +03:00
expose list.FilterMachesMsg (#77)
This commit is contained in:
parent
c426cb580b
commit
7a728eae31
@ -75,7 +75,7 @@ func (f filteredItems) matches() [][]int {
|
|||||||
return agg
|
return agg
|
||||||
}
|
}
|
||||||
|
|
||||||
type filterMatchesMsg []filteredItem
|
type FilterMatchesMsg []filteredItem
|
||||||
|
|
||||||
type statusMessageTimeoutMsg struct{}
|
type statusMessageTimeoutMsg struct{}
|
||||||
|
|
||||||
@ -694,7 +694,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
|
|||||||
return m, tea.Quit
|
return m, tea.Quit
|
||||||
}
|
}
|
||||||
|
|
||||||
case filterMatchesMsg:
|
case FilterMatchesMsg:
|
||||||
m.filteredItems = filteredItems(msg)
|
m.filteredItems = filteredItems(msg)
|
||||||
return m, nil
|
return m, nil
|
||||||
|
|
||||||
@ -1125,7 +1125,7 @@ func (m Model) spinnerView() string {
|
|||||||
func filterItems(m Model) tea.Cmd {
|
func filterItems(m Model) tea.Cmd {
|
||||||
return func() tea.Msg {
|
return func() tea.Msg {
|
||||||
if m.FilterInput.Value() == "" || m.filterState == Unfiltered {
|
if m.FilterInput.Value() == "" || m.filterState == Unfiltered {
|
||||||
return filterMatchesMsg(m.itemsAsFilterItems()) // return nothing
|
return FilterMatchesMsg(m.itemsAsFilterItems()) // return nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
targets := []string{}
|
targets := []string{}
|
||||||
@ -1146,7 +1146,7 @@ func filterItems(m Model) tea.Cmd {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return filterMatchesMsg(filterMatches)
|
return FilterMatchesMsg(filterMatches)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user