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

Method selectRegionUpdate

core/textfield.go:907–916  ·  view source on GitHub ↗

selectRegionUpdate updates current select region based on given cursor position relative to SelectStart position

(pos int)

Source from the content-addressed store, hash-verified

905// selectRegionUpdate updates current select region based on given cursor position
906// relative to SelectStart position
907func (tf *TextField) selectRegionUpdate(pos int) {
908 if pos < tf.selectInit {
909 tf.selectStart = pos
910 tf.selectEnd = tf.selectInit
911 } else {
912 tf.selectStart = tf.selectInit
913 tf.selectEnd = pos
914 }
915 tf.selectUpdate()
916}
917
918// selectAll selects all the text
919func (tf *TextField) selectAll() {

Callers 9

cursorForwardMethod · 0.95
cursorForwardWordMethod · 0.95
cursorBackwardMethod · 0.95
cursorBackwardWordMethod · 0.95
cursorDownMethod · 0.95
cursorUpMethod · 0.95
cursorStartMethod · 0.95
cursorEndMethod · 0.95
setCursorFromPixelMethod · 0.95

Calls 1

selectUpdateMethod · 0.95

Tested by

no test coverage detected