startSearch launches an async search and returns a tea.Cmd that will deliver the result via msSearchResultMsg.
(query string)
| 105 | // startSearch launches an async search and returns a tea.Cmd that will |
| 106 | // deliver the result via msSearchResultMsg. |
| 107 | func (m *multiSelectSearchField) startSearch(query string) tea.Cmd { |
| 108 | m.loading = true |
| 109 | searchFunc := m.searchFunc |
| 110 | return tea.Batch( |
| 111 | func() tea.Msg { |
| 112 | return msSearchResultMsg{query: query, result: searchFunc(query)} |
| 113 | }, |
| 114 | m.spinner.Tick, |
| 115 | ) |
| 116 | } |
| 117 | |
| 118 | // applySearchResult processes a completed search and rebuilds the option list. |
| 119 | func (m *multiSelectSearchField) applySearchResult(query string, result MultiSelectSearchResult) { |