MCPcopy Create free account
hub / github.com/cogentcore/core / cursorStart

Method cursorStart

core/textfield.go:767–775  ·  view source on GitHub ↗

cursorStart moves the cursor to the start of the text, updating selection if select mode is active.

()

Source from the content-addressed store, hash-verified

765// cursorStart moves the cursor to the start of the text, updating selection
766// if select mode is active.
767func (tf *TextField) cursorStart() {
768 tf.cursorPos = 0
769 tf.startPos = 0
770 tf.endPos = min(len(tf.editText), tf.startPos+tf.charWidth)
771 if tf.selectMode {
772 tf.selectRegionUpdate(tf.cursorPos)
773 }
774 tf.NeedsRender()
775}
776
777// cursorEnd moves the cursor to the end of the text, updating selection
778// if select mode is active.

Callers 1

handleKeyEventsMethod · 0.95

Calls 2

selectRegionUpdateMethod · 0.95
NeedsRenderMethod · 0.80

Tested by

no test coverage detected