fix(tui): editor: position completions correctly and account for padding
commit237dbde92cc514b2b247887c8fd29b0c9cb774aa
authorAyman Bagabas <ayman.bagabas@gmail.com>
dateThu 10 Jul 2025, 15:25 (1 year ago)
parent9df5080
internal/tui/components/chat/editor/editor.go+3−2
@@ -361,8 +361,9 @@ func (m *editorCmp) startCompletions() tea.Msg {
361361 })
362362 }
363363
364− x := m.textarea.Cursor().X + m.x + 1
365− y := m.textarea.Cursor().Y + m.y + 1
364+ cur := m.textarea.Cursor()
365+ x := cur.X + m.x // adjust for padding
366+ y := cur.Y + m.y + 1
366367 return completions.OpenCompletionsMsg{
367368 Completions: completionItems,
368369 X: x,
internal/tui/components/completions/completions.go+1−1
@@ -43,7 +43,7 @@ type Completions interface {
4343type completionsCmp struct {
4444 width int
4545 height int // Height of the completions component`
46− x int // X position for the completions popup\
46+ x int // X position for the completions popup
4747 y int // Y position for the completions popup
4848 open bool // Indicates if the completions are open
4949 keyMap KeyMap