diff --git a/internal/tui/components/completions/completions.go b/internal/tui/components/completions/completions.go index e9c410d37a91ac245b7766cb7b1469dd4b421eda..5a6bcfe92e23f38c3f40c84770a0dcc9893e59d5 100644 --- a/internal/tui/components/completions/completions.go +++ b/internal/tui/components/completions/completions.go @@ -9,6 +9,8 @@ import ( "github.com/charmbracelet/lipgloss/v2" ) +const maxCompletionsHeight = 10 + type Completion struct { Title string // The title of the completion item Value any // The value of the completion item @@ -153,7 +155,7 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmds []tea.Cmd cmds = append(cmds, c.list.Filter(msg.Query)) itemsLen := len(c.list.Items()) - c.height = max(min(10, itemsLen), 1) + c.height = max(min(maxCompletionsHeight, itemsLen), 1) cmds = append(cmds, c.list.SetSize(c.width, c.height)) if itemsLen == 0 { // Close completions if no items match the query