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

Method cursorDelete

texteditor/nav.go:598–610  ·  view source on GitHub ↗

cursorDelete deletes character(s) immediately after the cursor

(steps int)

Source from the content-addressed store, hash-verified

596
597// cursorDelete deletes character(s) immediately after the cursor
598func (ed *Editor) cursorDelete(steps int) {
599 ed.validateCursor()
600 if ed.HasSelection() {
601 ed.deleteSelection()
602 return
603 }
604 // note: no update b/c signal from buf will drive update
605 org := ed.CursorPos
606 ed.cursorForward(steps)
607 ed.Buffer.DeleteText(org, ed.CursorPos, EditSignal)
608 ed.SetCursorShow(org)
609 ed.NeedsRender()
610}
611
612// cursorBackspaceWord deletes words(s) immediately before cursor
613func (ed *Editor) cursorBackspaceWord(steps int) {

Callers 1

keyInputMethod · 0.95

Calls 7

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

Tested by

no test coverage detected