Skip to content

Commit

Permalink
fix: offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Feb 7, 2025
1 parent 9aba422 commit 9daf684
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions textinput/textinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ type Model struct {
VirtualCursor bool
virtualCursor cursor.Model

// ColumnOffset is the number of columns that the cursor is offset from the
// start of the line.
ColumnOffset int

// RowOffset is the number of rows that the cursor is offset from the start
// of the screen.
RowOffset int

// Styling. FocusedStyle and BlurredStyle are used to style the textarea in
// focused and blurred states.
Styles Styles
Expand Down Expand Up @@ -894,13 +886,10 @@ func (m Model) Cursor() *tea.Cursor {
w := lipgloss.Width

xOffset := m.Position() +
w(m.promptView()) +
m.ColumnOffset

yOffset := m.RowOffset
w(m.promptView())

style := m.Styles.Cursor
c := tea.NewCursor(xOffset, yOffset)
c := tea.NewCursor(xOffset, 0)
c.Blink = style.Blink
c.Color = style.Color
c.Shape = style.Shape
Expand Down

0 comments on commit 9daf684

Please sign in to comment.