diff --git a/textarea/textarea.go b/textarea/textarea.go index 5a080c88..c7040058 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -286,7 +286,12 @@ func (m *Model) Length() int { for _, row := range m.value { l += rw.StringWidth(string(row)) } - return l + 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.