From 9266653c39ca471e519613c82eccf66e123763e9 Mon Sep 17 00:00:00 2001 From: remiposo <57336808+remiposo@users.noreply.github.com> Date: Sun, 14 May 2023 01:56:18 +0900 Subject: [PATCH] Reset blink only when CursorBlink (#378) --- textarea/textarea.go | 2 +- textinput/textinput.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/textarea/textarea.go b/textarea/textarea.go index 5b2da4c..b614a90 100644 --- a/textarea/textarea.go +++ b/textarea/textarea.go @@ -1020,7 +1020,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { newRow, newCol := m.cursorLineNumber(), m.col m.Cursor, cmd = m.Cursor.Update(msg) - if newRow != oldRow || newCol != oldCol { + if (newRow != oldRow || newCol != oldCol) && m.Cursor.Mode() == cursor.CursorBlink { m.Cursor.Blink = false cmd = m.Cursor.BlinkCmd() } diff --git a/textinput/textinput.go b/textinput/textinput.go index b609706..f8990f6 100644 --- a/textinput/textinput.go +++ b/textinput/textinput.go @@ -595,7 +595,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { m.Cursor, cmd = m.Cursor.Update(msg) cmds = append(cmds, cmd) - if oldPos != m.pos { + if oldPos != m.pos && m.Cursor.Mode() == cursor.CursorBlink { m.Cursor.Blink = false cmds = append(cmds, m.Cursor.BlinkCmd()) }