From e200bf8c810971f9c3b6bac0f69d82bb959e3d53 Mon Sep 17 00:00:00 2001 From: Maas Lalani Date: Fri, 5 Aug 2022 13:54:41 -0400 Subject: [PATCH] feat: LineCount method for counting number of lines in textarea --- textarea/textarea.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/textarea/textarea.go b/textarea/textarea.go index 6cdbffe..c704005 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -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