@@ -70,8 +70,8 @@ func New() Completions {
70 list.WithHideFilterInput(true),
70 list.WithHideFilterInput(true),
72 return &completionsCmp{
72 return &completionsCmp{
73− width: 30,
73+ width: 0,
74− height: 10,
74+ height: 0,
76 query: "",
76 query: "",
77 keyMap: completionsKeyMap,
77 keyMap: completionsKeyMap,
@@ -89,6 +89,10 @@ func (c *completionsCmp) Init() tea.Cmd {
89// Update implements Completions.
89// Update implements Completions.
90func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
90func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
91 switch msg := msg.(type) {
91 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)
92 case tea.KeyPressMsg:
96 case tea.KeyPressMsg:
94 case key.Matches(msg, c.keyMap.Up):
98 case key.Matches(msg, c.keyMap.Up):
@@ -135,7 +139,7 @@ func (c *completionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
135 item := NewCompletionItem(completion.Title, completion.Value, WithBackgroundColor(t.BgSubtle))
139 item := NewCompletionItem(completion.Title, completion.Value, WithBackgroundColor(t.BgSubtle))
136 items = append(items, item)
140 items = append(items, item)
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
139 cmds := []tea.Cmd{
143 cmds := []tea.Cmd{
140 c.list.SetSize(c.width, c.height),
144 c.list.SetSize(c.width, c.height),
141 c.list.SetItems(items),
145 c.list.SetItems(items),