bubbles icon indicating copy to clipboard operation
bubbles copied to clipboard

textinput: API to programmatically move cursor

Open antonmedv opened this issue 3 years ago • 2 comments

I'd like to be able to see the system cursor in my app.

Is it possible? Thanks.

antonmedv avatar Mar 10 '22 16:03 antonmedv

I see in bubbles package for textinput cursor is “emulated”. It will be cool to have api to show cursor and move it position via commands.

antonmedv avatar Mar 10 '22 21:03 antonmedv

This is a good idea. Transferring to Bubbles so we can track it.

meowgorithm avatar Apr 10 '22 13:04 meowgorithm

We now have a public SetCursor method to programatically move the cursor.

ti := textinput.New()
ti.Value = "Blah blah..."
ti.SetCursor(4)

https://github.com/charmbracelet/bubbles/blob/a4ed54327f08e510ec54408c93c2a08285c727af/textinput/textinput.go#L149-L154

maaslalani avatar Sep 14 '22 19:09 maaslalani