MCPcopy
hub / github.com/mathaou/termdbms / blinkCmd

Method blinkCmd

tuiutil/textinput.go:763–785  ·  view source on GitHub ↗

blinkCmd is an internal command used to manage cursor blinking.

()

Source from the content-addressed store, hash-verified

761
762// blinkCmd is an internal command used to manage cursor blinking.
763func (m *TextInputModel) blinkCmd() tea.Cmd {
764 if m.cursorMode != CursorBlink {
765 return nil
766 }
767
768 if m.blinkCtx != nil && m.blinkCtx.cancel != nil {
769 m.blinkCtx.cancel()
770 }
771
772 ctx, cancel := context.WithTimeout(m.blinkCtx.ctx, m.BlinkSpeed)
773 m.blinkCtx.cancel = cancel
774
775 m.blinkTag++
776
777 return func() tea.Msg {
778 defer cancel()
779 <-ctx.Done()
780 if ctx.Err() == context.DeadlineExceeded {
781 return blinkMsg{id: m.id, tag: m.blinkTag}
782 }
783 return blinkCanceled{}
784 }
785}
786
787// Blink is a command used to initialize cursor blinking.
788func Blink() tea.Msg {

Callers 2

FocusCommandMethod · 0.95
UpdateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected