fix(tui): completions: ensure minimum height for completions list

This commit is contained in:
Ayman Bagabas
2025-07-24 09:45:58 -04:00
parent 28aac45067
commit b4468381b8

View File

@@ -187,7 +187,7 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
c.x = c.wWidth - width - 1
}
c.width = width
c.height = max(min(c.height, len(items)), 1) // Ensure at least 1 item height
c.height = max(min(maxCompletionsHeight, len(items)), 1) // Ensure at least 1 item height
return c, tea.Batch(
c.list.SetItems(items),
c.list.SetSize(c.width, c.height),