mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-16 01:43:21 +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 {
|
if m.useVirtualCursor {
|
||||||
m.virtualCursor, cmd = m.virtualCursor.Update(msg)
|
m.virtualCursor, cmd = m.virtualCursor.Update(msg)
|
||||||
cmds = append(cmds, cmd)
|
cmds = append(cmds, cmd)
|
||||||
}
|
|
||||||
|
|
||||||
if oldPos != m.pos && m.virtualCursor.Mode() == cursor.CursorBlink {
|
// If the cursor position changed, reset the blink state. This is a
|
||||||
m.virtualCursor.Blink = false
|
// small UX nuance that makes cursor movement obvious and feel snappy.
|
||||||
cmds = append(cmds, m.virtualCursor.BlinkCmd())
|
if oldPos != m.pos && m.virtualCursor.Mode() == cursor.CursorBlink {
|
||||||
|
m.virtualCursor.Blink = false
|
||||||
|
cmds = append(cmds, m.virtualCursor.BlinkCmd())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m.handleOverflow()
|
m.handleOverflow()
|
||||||
|
|||||||
Reference in New Issue
Block a user