on main help sign in
fix(tui): completions should not close on no results (#198)
833eedeCarlos Alexandro Becker
internal/tui/components/completions/completions.go−4
@@ -157,10 +157,6 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
157 itemsLen := len(c.list.Items())
157 itemsLen := len(c.list.Items())
158 c.height = max(min(maxCompletionsHeight, itemsLen), 1)
158 c.height = max(min(maxCompletionsHeight, itemsLen), 1)
159 cmds = append(cmds, c.list.SetSize(c.width, c.height))
159 cmds = append(cmds, c.list.SetSize(c.width, c.height))
160− if itemsLen == 0 {
161− // Close completions if no items match the query
162− cmds = append(cmds, util.CmdHandler(CloseCompletionsMsg{}))
163− }
164 return c, tea.Batch(cmds...)
160 return c, tea.Batch(cmds...)
165 }
161 }
166 return c, nil
162 return c, nil