From b1b5a499b719d18670dd1dad47e6b671f010e0cc Mon Sep 17 00:00:00 2001 From: Maxim Slipenko Date: Wed, 9 Nov 2022 12:44:07 +0000 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20ResetView=20=D0=B8=20ResetChanged?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- textarea/textarea.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/textarea/textarea.go b/textarea/textarea.go index 5277736..51233da 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -466,10 +466,18 @@ func (m *Model) Reset() { } func (m *Model) ResetWithoutValue() { + m.ResetView() + m.ResetChanged() +} + +func (m *Model) ResetView() { m.col = 0 m.row = 0 m.viewport.GotoTop() m.SetCursor(0) +} + +func (m *Model) ResetChanged() { m.isChanged = false }