mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
fix(textinput): account for width when calculating cursor position
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user