@@ -9,6 +9,8 @@ import (
99 "github.com/charmbracelet/lipgloss/v2"
1010)
1111
12+const maxCompletionsHeight = 10
13+
1214type Completion struct {
1315 Title string // The title of the completion item
1416 Value any // The value of the completion item
@@ -153,7 +155,7 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
153155 var cmds []tea.Cmd
154156 cmds = append(cmds, c.list.Filter(msg.Query))
155157 itemsLen := len(c.list.Items())
156− c.height = max(min(10, itemsLen), 1)
158+ c.height = max(min(maxCompletionsHeight, itemsLen), 1)
157159 cmds = append(cmds, c.list.SetSize(c.width, c.height))
158160 if itemsLen == 0 {
159161 // Close completions if no items match the query