on main help sign in
fix(tui): completions: don't set initial width
commitfd1adf07e6152a5c28fb105980bb36b76244f3f2 authorAyman Bagabas <ayman.bagabas@gmail.com> dateWed 23 Jul 2025, 17:58 (1 year ago) parent6f1f7a2
1 file changed+1−2
internal/tui/components/completions/completions.go+1−2
internal/tui/components/completions/completions.go+1−2
@@ -107,7 +107,6 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
107107 switch msg := msg.(type) {
108108 case tea.WindowSizeMsg:
109109 c.wWidth = msg.Width
110− c.width = min(listWidth(c.list.Items()), maxCompletionsWidth)
111110 c.height = min(msg.Height-c.y, 15)
112111 return c, nil
113112 case tea.KeyPressMsg:
@@ -180,7 +179,7 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
180179 if c.x+width >= c.wWidth {
181180 c.x = c.wWidth - width - 1
182181 }
183− c.width = max(width, c.wWidth-minCompletionsWidth-1)
182+ c.width = width
184183 c.height = max(min(c.height, len(items)), 1) // Ensure at least 1 item height
185184 return c, tea.Batch(
186185 c.list.SetItems(items),