mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
fix(textarea): suppress blink messages when real cursor is active
This commit is contained in:
@@ -1196,13 +1196,18 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
|
||||
m.viewport = &vp
|
||||
cmds = append(cmds, cmd)
|
||||
|
||||
newRow, newCol := m.cursorLineNumber(), m.col
|
||||
if m.useVirtualCursor {
|
||||
m.virtualCursor, cmd = m.virtualCursor.Update(msg)
|
||||
|
||||
// If the cursor has moved, reset the blink state. This is a small UX
|
||||
// nuance that makes cursor movement obvious and feel snappy.
|
||||
newRow, newCol := m.cursorLineNumber(), m.col
|
||||
if (newRow != oldRow || newCol != oldCol) && m.virtualCursor.Mode() == cursor.CursorBlink {
|
||||
m.virtualCursor.Blink = false
|
||||
cmd = m.virtualCursor.BlinkCmd()
|
||||
}
|
||||
cmds = append(cmds, cmd)
|
||||
}
|
||||
|
||||
m.repositionView()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user