on main help sign in
fix(ui): completions: simplify Close method
0c8cd47Ayman Bagabas
internal/ui/completions/completions.go+3−3
@@ -126,9 +126,8 @@ func (c *Completions) SetFiles(files []string) {
126}
126}
127
127
128// Close closes the completions popup.
128// Close closes the completions popup.
129−func (c *Completions) Close() tea.Msg {
129+func (c *Completions) Close() {
130 c.open = false
130 c.open = false
131− return ClosedMsg{}
132}
131}
133
132
134// Filter filters the completions with the given query.
133// Filter filters the completions with the given query.
@@ -188,7 +187,8 @@ func (c *Completions) Update(msg tea.KeyPressMsg) (tea.Msg, bool) {
188 return c.selectCurrent(false), true
187 return c.selectCurrent(false), true
189
188
190 case key.Matches(msg, c.keyMap.Cancel):
189 case key.Matches(msg, c.keyMap.Cancel):
191− return c.Close(), true
190+ c.Close()
191+ return ClosedMsg{}, true
192 }
192 }
193
193
194 return nil, false
194 return nil, false