Thu 1 Aug 13:42:01 CEST 2024
This commit is contained in:
parent
35d898845c
commit
97bce27750
20
tui.go
20
tui.go
|
@ -77,9 +77,23 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
if ignoreInput {
|
if ignoreInput {
|
||||||
return m, cmd
|
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)
|
m.list, cmd = m.list.Update(msg)
|
||||||
return m, cmd
|
cmds = append(cmds, cmd)
|
||||||
|
|
||||||
|
return m, tea.Batch(cmds...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m model) View() string {
|
func (m model) View() string {
|
||||||
|
@ -112,7 +126,7 @@ func initialModel(items []list.Item) model {
|
||||||
const defaultWidth = 20
|
const defaultWidth = 20
|
||||||
|
|
||||||
l := list.New(items, itemDelegate{}, defaultWidth, 14)
|
l := list.New(items, itemDelegate{}, defaultWidth, 14)
|
||||||
l.SetShowFilter(false)
|
l.SetShowFilter(true)
|
||||||
l.SetShowStatusBar(false)
|
l.SetShowStatusBar(false)
|
||||||
l.SetFilteringEnabled(true)
|
l.SetFilteringEnabled(true)
|
||||||
l.SetShowHelp(false)
|
l.SetShowHelp(false)
|
||||||
|
|
Loading…
Reference in New Issue