fix(textinput): account for width when calculating cursor position

This commit is contained in:
Ayman Bagabas
2025-03-10 15:18:55 -04:00
parent 6af59e6ea4
commit 59511a71e0
+5 -1
View File
@@ -886,8 +886,12 @@ func (m Model) Cursor() *tea.Cursor {
w := lipgloss.Width
promptWidth := w(m.promptView())
xOffset := m.Position() +
w(m.promptView())
promptWidth
if m.width > 0 {
xOffset = min(xOffset, m.width+promptWidth)
}
style := m.Styles.Cursor
c := tea.NewCursor(xOffset, 0)