@@ -70,8 +70,8 @@ func New() Completions {
7070 list.WithHideFilterInput(true),
7171 )
7272 return &completionsCmp{
73− width: 30,
74− height: 10,
73+ width: 0,
74+ height: 0,
7575 list: l,
7676 query: "",
7777 keyMap: completionsKeyMap,
@@ -89,6 +89,10 @@ func (c *completionsCmp) Init() tea.Cmd {
8989// Update implements Completions.
9090func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
9191 switch msg := msg.(type) {
92+ case tea.WindowSizeMsg:
93+ c.width = min(msg.Width-c.x, 80)
94+ c.height = min(msg.Height-c.y, 15)
95+ return c, nil
9296 case tea.KeyPressMsg:
9397 switch {
9498 case key.Matches(msg, c.keyMap.Up):
@@ -135,7 +139,7 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
135139 item := NewCompletionItem(completion.Title, completion.Value, WithBackgroundColor(t.BgSubtle))
136140 items = append(items, item)
137141 }
138− c.height = max(min(10, len(items)), 1) // Ensure at least 1 item height
142+ c.height = max(min(c.height, len(items)), 1) // Ensure at least 1 item height
139143 cmds := []tea.Cmd{
140144 c.list.SetSize(c.width, c.height),
141145 c.list.SetItems(items),