Skip to content

Commit

Permalink
Reset blink only when CursorBlink (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
remiposo authored May 13, 2023
1 parent 39f4eea commit 9266653
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion textarea/textarea.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
2 changes: 1 addition & 1 deletion textinput/textinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit 9266653

Please sign in to comment.