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

Method setSyncNode

core/treesync.go:43–48  ·  view source on GitHub ↗

setSyncNode sets the sync source node that we are viewing, and syncs the view of its tree. It is called routinely via SyncToSrc during tree updating. It uses tree Config mechanism to perform minimal updates to remain in sync.

(sn tree.Node, tvIndex *int, init bool, depth int)

Source from the content-addressed store, hash-verified

41// It uses tree Config mechanism to perform minimal updates to
42// remain in sync.
43func (tr *Tree) setSyncNode(sn tree.Node, tvIndex *int, init bool, depth int) {
44 if tr.SyncNode != sn {
45 tr.SyncNode = sn
46 }
47 tr.syncToSrc(tvIndex, init, depth)
48}
49
50// Resync resynchronizes the [Tree] relative to the [Tree.SyncNode]
51// underlying nodes and triggers an update.

Callers 1

syncToSrcMethod · 0.80

Calls 1

syncToSrcMethod · 0.95

Tested by

no test coverage detected