From 3cbcdd9249746eddfd32eceb6a10fa46eb2825d0 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Mon, 26 May 2025 07:54:46 -0400 Subject: [PATCH] chore(textinput): minor logic improvement with regard to cursors --- textinput/textinput.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/textinput/textinput.go b/textinput/textinput.go index 5774ea1..fe61757 100644 --- a/textinput/textinput.go +++ b/textinput/textinput.go @@ -666,11 +666,13 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { if m.useVirtualCursor { m.virtualCursor, cmd = m.virtualCursor.Update(msg) cmds = append(cmds, cmd) - } - if oldPos != m.pos && m.virtualCursor.Mode() == cursor.CursorBlink { - m.virtualCursor.Blink = false - cmds = append(cmds, m.virtualCursor.BlinkCmd()) + // If the cursor position changed, reset the blink state. This is a + // small UX nuance that makes cursor movement obvious and feel snappy. + if oldPos != m.pos && m.virtualCursor.Mode() == cursor.CursorBlink { + m.virtualCursor.Blink = false + cmds = append(cmds, m.virtualCursor.BlinkCmd()) + } } m.handleOverflow()