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

Method hasSelection

core/textfield.go:868–871  ·  view source on GitHub ↗

hasSelection returns whether there is a selected region of text

()

Source from the content-addressed store, hash-verified

866
867// hasSelection returns whether there is a selected region of text
868func (tf *TextField) hasSelection() bool {
869 tf.selectUpdate()
870 return tf.selectStart < tf.selectEnd
871}
872
873// selection returns the currently selected text
874func (tf *TextField) selection() string {

Callers 11

cursorBackspaceMethod · 0.95
cursorDeleteMethod · 0.95
cursorBackspaceWordMethod · 0.95
cursorDeleteWordMethod · 0.95
selectionMethod · 0.95
deleteSelectionMethod · 0.95
copyMethod · 0.95
insertAtCursorMethod · 0.95
contextMenuMethod · 0.95
renderSelectMethod · 0.95
setCursorFromPixelMethod · 0.95

Calls 1

selectUpdateMethod · 0.95

Tested by

no test coverage detected