From d3bd075ed2b27a3b5d76bb79b5d1c928dcd780d0 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 5 Sep 2024 14:10:05 -0300 Subject: [PATCH] feat(cursor): focus/blur support (#581) Signed-off-by: Carlos Alexandro Becker --- cursor/cursor.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cursor/cursor.go b/cursor/cursor.go index a4f47938..1297422d 100644 --- a/cursor/cursor.go +++ b/cursor/cursor.go @@ -101,6 +101,13 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { cmd := m.BlinkCmd() return m, cmd + case tea.FocusMsg: + return m, m.Focus() + + case tea.BlurMsg: + m.Blur() + return m, nil + case BlinkMsg: // We're choosy about whether to accept blinkMsgs so that our cursor // only exactly when it should.