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

Method cursorDeleteWord

texteditor/nav.go:630–642  ·  view source on GitHub ↗

cursorDeleteWord deletes word(s) immediately after the cursor

(steps int)

Source from the content-addressed store, hash-verified

628
629// cursorDeleteWord deletes word(s) immediately after the cursor
630func (ed *Editor) cursorDeleteWord(steps int) {
631 ed.validateCursor()
632 if ed.HasSelection() {
633 ed.deleteSelection()
634 return
635 }
636 // note: no update b/c signal from buf will drive update
637 org := ed.CursorPos
638 ed.cursorForwardWord(steps)
639 ed.Buffer.DeleteText(org, ed.CursorPos, EditSignal)
640 ed.SetCursorShow(org)
641 ed.NeedsRender()
642}
643
644// cursorKill deletes text from cursor to end of text
645func (ed *Editor) cursorKill() {

Callers 1

keyInputMethod · 0.95

Calls 7

validateCursorMethod · 0.95
HasSelectionMethod · 0.95
deleteSelectionMethod · 0.95
cursorForwardWordMethod · 0.95
SetCursorShowMethod · 0.95
NeedsRenderMethod · 0.80
DeleteTextMethod · 0.45

Tested by

no test coverage detected