From fd1adf07e6152a5c28fb105980bb36b76244f3f2 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 23 Jul 2025 17:58:10 -0400 Subject: [PATCH] fix(tui): completions: don't set initial width --- internal/tui/components/completions/completions.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/internal/tui/components/completions/completions.go b/internal/tui/components/completions/completions.go index e8670cec13b7545dbb0bc72d77bbbeface24a920..c034d0da4fefaa4731b8eb5899543134f13d1e52 100644 --- a/internal/tui/components/completions/completions.go +++ b/internal/tui/components/completions/completions.go @@ -107,7 +107,6 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { switch msg := msg.(type) { case tea.WindowSizeMsg: c.wWidth = msg.Width - c.width = min(listWidth(c.list.Items()), maxCompletionsWidth) c.height = min(msg.Height-c.y, 15) return c, nil case tea.KeyPressMsg: @@ -180,7 +179,7 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if c.x+width >= c.wWidth { c.x = c.wWidth - width - 1 } - c.width = max(width, c.wWidth-minCompletionsWidth-1) + c.width = width c.height = max(min(c.height, len(items)), 1) // Ensure at least 1 item height return c, tea.Batch( c.list.SetItems(items),