Search for values

pull/268/head
Anton Medvedev 9 months ago
parent c9e585c37c
commit 2f381f0bc7
No known key found for this signature in database

@ -230,15 +230,11 @@ func (m *model) handleSearchKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
case msg.Type == tea.KeyEscape:
m.searchInput.Blur()
m.searchInput.SetValue("")
m.searchError = nil
m.searchResults = nil
m.searchResultsCursor = 0
m.search("")
case msg.Type == tea.KeyEnter:
m.searchInput.Blur()
if m.searchInput.Value() != "" {
m.search(m.searchInput.Value())
}
m.search(m.searchInput.Value())
default:
m.searchInput, cmd = m.searchInput.Update(msg)
@ -709,6 +705,10 @@ func (m *model) search(s string) {
m.searchError = nil
m.searchResults = nil
m.searchResultsCursor = 0
m.searchResultsIndexes = make(map[*node][]match)
if s == "" {
return
}
code, ci := regexCase(s)
if ci {

Loading…
Cancel
Save