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

Method cursorBackspaceWord

core/textfield.go:826–836  ·  view source on GitHub ↗

cursorBackspaceWord deletes words(s) immediately before cursor

(steps int)

Source from the content-addressed store, hash-verified

824
825// cursorBackspaceWord deletes words(s) immediately before cursor
826func (tf *TextField) cursorBackspaceWord(steps int) {
827 if tf.hasSelection() {
828 tf.deleteSelection()
829 return
830 }
831 org := tf.cursorPos
832 tf.cursorBackwardWord(steps)
833 tf.edited = true
834 tf.editText = append(tf.editText[:tf.cursorPos], tf.editText[org:]...)
835 tf.NeedsRender()
836}
837
838// cursorDeleteWord deletes word(s) immediately after the cursor
839func (tf *TextField) cursorDeleteWord(steps int) {

Callers 1

handleKeyEventsMethod · 0.95

Calls 4

hasSelectionMethod · 0.95
deleteSelectionMethod · 0.95
cursorBackwardWordMethod · 0.95
NeedsRenderMethod · 0.80

Tested by

no test coverage detected