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

Method deleteTextRect

texteditor/buffer.go:722–735  ·  view source on GitHub ↗

deleteTextRect deletes rectangular region of text between start, end defining the upper-left and lower-right corners of a rectangle. Fails if st.Ch >= ed.Ch. Sets the timestamp on resulting text.Edit to now. An Undo record is automatically saved depending on Undo.Off setting.

(st, ed lexer.Pos, signal bool)

Source from the content-addressed store, hash-verified

720// Fails if st.Ch >= ed.Ch. Sets the timestamp on resulting text.Edit to now.
721// An Undo record is automatically saved depending on Undo.Off setting.
722func (tb *Buffer) deleteTextRect(st, ed lexer.Pos, signal bool) *text.Edit {
723 tb.FileModCheck()
724 tbe := tb.Lines.DeleteTextRect(st, ed)
725 if tbe == nil {
726 return tbe
727 }
728 if signal {
729 tb.signalMods()
730 }
731 if tb.Autosave {
732 go tb.autoSave()
733 }
734 return tbe
735}
736
737// insertText is the primary method for inserting text into the buffer.
738// It inserts new text at given starting position, optionally signaling

Callers 1

CutRectMethod · 0.45

Calls 4

FileModCheckMethod · 0.95
signalModsMethod · 0.95
autoSaveMethod · 0.95
DeleteTextRectMethod · 0.80

Tested by

no test coverage detected