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

Method InsertTextRect

texteditor/text/lines.go:350–354  ·  view source on GitHub ↗

InsertTextRect inserts a rectangle of text defined in given Edit record, (e.g., from RegionRect or DeleteRect). Returns a copy of the Edit record with an updated timestamp. An Undo record is automatically saved depending on Undo.Off setting.

(tbe *Edit)

Source from the content-addressed store, hash-verified

348// Returns a copy of the Edit record with an updated timestamp.
349// An Undo record is automatically saved depending on Undo.Off setting.
350func (ls *Lines) InsertTextRect(tbe *Edit) *Edit {
351 ls.Lock()
352 defer ls.Unlock()
353 return ls.insertTextRect(tbe)
354}
355
356// ReplaceText does DeleteText for given region, and then InsertText at given position
357// (typically same as delSt but not necessarily).

Callers 1

insertTextRectMethod · 0.80

Calls 3

insertTextRectMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected