Thu 1 Aug 13:42:01 CEST 2024

This commit is contained in:
Thomas Avé 2024-08-01 13:42:01 +02:00
parent 35d898845c
commit 97bce27750
1 changed files with 17 additions and 3 deletions

20
tui.go
View File

@ -77,9 +77,23 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if ignoreInput {
return m, cmd
}
m.textInput, cmd = m.textInput.Update(msg)
cmds := []tea.Cmd{
textinput.Blink,
}
// m.textInput, cmd = m.textInput.Update(msg)
// cmds = append(cmds, cmd)
if !m.list.SettingFilter() {
m.list, cmd = m.list.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune("/")})
cmds = append(cmds, cmd)
}
m.list, cmd = m.list.Update(msg)
return m, cmd
cmds = append(cmds, cmd)
return m, tea.Batch(cmds...)
}
func (m model) View() string {
@ -112,7 +126,7 @@ func initialModel(items []list.Item) model {
const defaultWidth = 20
l := list.New(items, itemDelegate{}, defaultWidth, 14)
l.SetShowFilter(false)
l.SetShowFilter(true)
l.SetShowStatusBar(false)
l.SetFilteringEnabled(true)
l.SetShowHelp(false)