Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 27fad39

Browse files
committed
fix(ai pane): proper inster of table/column in input
1 parent e975d4a commit 27fad39

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

internal/ui/ai/ai.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -924,9 +924,8 @@ func (m *Model) handleOverlayKey(msg tea.KeyMsg) tea.Cmd {
924924
case "enter":
925925
if m.overlayCursor >= 0 && m.overlayCursor < len(m.overlayFiltered) {
926926
item := m.overlayFiltered[m.overlayCursor]
927-
val := m.textarea.Value()
928-
m.textarea.SetValue(val + string(m.overlayType) + item + " ")
929-
m.textarea.SetCursor(len(m.textarea.Value()))
927+
// Insert at the textarea cursor (where @ / # was pressed), not at EOF.
928+
m.textarea.InsertString(string(m.overlayType) + item + " ")
930929
}
931930
m.showOverlay = false
932931
case "backspace":

0 commit comments

Comments
 (0)