Skip to content

Commit

Permalink
feat(cursor): focus/blur support (#581)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 authored Sep 5, 2024
1 parent 6fc27e9 commit d3bd075
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cursor/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d3bd075

Please sign in to comment.