Skip to content

Make cursor.blinkCanceled public so that it can be handled #834

@Encephala

Description

@Encephala

Is your feature request related to a problem? Please describe.
I'm writing a tea.Model that wraps around a bubbles.textinput and a few other bubbles.
In my Update method, I have a switch statement on the msg.(type), in which I handle certain messages I send myself but forward for instance tea.KeyMsg to the inner textinput. I want to include a default case to that switch statement that panics, so that I ensure I don't accidentally forgot to handle a message type while developing.

Now the issue occurs when the inner textinput is Focus'd, because then cursor.blinkCanceled messages sometimes pass through the Update chain, which triggers the panic I have.
This wouldn't be a problem if I could simply have case cursor.blinkCanceled:, but since blinkCanceled is local to the cursor package the compiler won't let me catch it.

Describe the solution you'd like
type cursor.blinkCanceled... -> type cursor.BlinkCanceled... so that the type is exposed to the outside.

Describe alternatives you've considered
For now I've disabled blinking altogether on the inner textinput, but that feels like a shame!

Additional context

Update:
Actually, setting input.Cursor.Blink = false doesn't appear to prevent the blinkCanceled messages from being fired. Would there be another way to prevent these messages from being fired?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions