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

Method DeleteTextRect

texteditor/text/lines.go:331–335  ·  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 Edit to now. An Undo record is automatically saved depending on Undo.Off setting.

(st, ed lexer.Pos)

Source from the content-addressed store, hash-verified

329// Fails if st.Ch >= ed.Ch. Sets the timestamp on resulting Edit to now.
330// An Undo record is automatically saved depending on Undo.Off setting.
331func (ls *Lines) DeleteTextRect(st, ed lexer.Pos) *Edit {
332 ls.Lock()
333 defer ls.Unlock()
334 return ls.deleteTextRect(st, ed)
335}
336
337// InsertText is the primary method for inserting text,
338// at given starting position. Sets the timestamp on resulting Edit to now.

Callers 1

deleteTextRectMethod · 0.80

Calls 3

deleteTextRectMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected