mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
chore(textinput): minor logic improvement with regard to cursors
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user