Skip to content

Commit

Permalink
feat: LineCount method for counting number of lines in textarea
Browse files Browse the repository at this point in the history
  • Loading branch information
maaslalani committed Aug 5, 2022
1 parent 47eee84 commit e200bf8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions textarea/textarea.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ func (m *Model) Length() int {
return l + len(m.value) - 1
}

// LineCount returns the number of lines that are currently in the text input.
func (m *Model) LineCount() int {
return len(m.value)
}

// Line returns the line position.
func (m Model) Line() int {
return m.row
Expand Down

0 comments on commit e200bf8

Please sign in to comment.