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

Method pasteAssignSync

core/treesync.go:413–421  ·  view source on GitHub ↗

pasteAssignSync assigns mime data (only the first one!) to this node

(md mimedata.Mimes)

Source from the content-addressed store, hash-verified

411
412// pasteAssignSync assigns mime data (only the first one!) to this node
413func (tr *Tree) pasteAssignSync(md mimedata.Mimes) {
414 sl, _ := tr.syncNodesFromMimeData(md)
415 if len(sl) == 0 {
416 return
417 }
418 tr.SyncNode.AsTree().CopyFrom(sl[0])
419 tr.NeedsLayout()
420 tr.sendChangeEvent(nil)
421}
422
423// pasteAtSync inserts object(s) from mime data at rel position to this node.
424// If another item with the same name already exists, it will

Callers 1

pasteAssignMethod · 0.95

Calls 5

syncNodesFromMimeDataMethod · 0.95
sendChangeEventMethod · 0.95
CopyFromMethod · 0.65
AsTreeMethod · 0.65
NeedsLayoutMethod · 0.45

Tested by

no test coverage detected