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

Method cursorDeleteWord

core/textfield.go:839–850  ·  view source on GitHub ↗

cursorDeleteWord deletes word(s) immediately after the cursor

(steps int)

Source from the content-addressed store, hash-verified

837
838// cursorDeleteWord deletes word(s) immediately after the cursor
839func (tf *TextField) cursorDeleteWord(steps int) {
840 if tf.hasSelection() {
841 tf.deleteSelection()
842 return
843 }
844 // note: no update b/c signal from buf will drive update
845 org := tf.cursorPos
846 tf.cursorForwardWord(steps)
847 tf.edited = true
848 tf.editText = append(tf.editText[:tf.cursorPos], tf.editText[org:]...)
849 tf.NeedsRender()
850}
851
852// cursorKill deletes text from cursor to end of text
853func (tf *TextField) cursorKill() {

Callers 1

handleKeyEventsMethod · 0.95

Calls 4

hasSelectionMethod · 0.95
deleteSelectionMethod · 0.95
cursorForwardWordMethod · 0.95
NeedsRenderMethod · 0.80

Tested by

no test coverage detected