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

Method deleteSelection

texteditor/select.go:324–328  ·  view source on GitHub ↗

deleteSelection deletes any selected text, without adding to clipboard -- returns text deleted as text.Edit (nil if none)

()

Source from the content-addressed store, hash-verified

322// deleteSelection deletes any selected text, without adding to clipboard --
323// returns text deleted as text.Edit (nil if none)
324func (ed *Editor) deleteSelection() *text.Edit {
325 tbe := ed.Buffer.DeleteText(ed.SelectRegion.Start, ed.SelectRegion.End, EditSignal)
326 ed.SelectReset()
327 return tbe
328}
329
330// Copy copies any selected text to the clipboard, and returns that text,
331// optionally resetting the current selection

Callers 6

cursorBackspaceMethod · 0.95
cursorDeleteMethod · 0.95
cursorBackspaceWordMethod · 0.95
cursorDeleteWordMethod · 0.95
CutMethod · 0.95
InsertAtCursorMethod · 0.95

Calls 2

SelectResetMethod · 0.95
DeleteTextMethod · 0.45

Tested by

no test coverage detected