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)
| 41 | // It uses tree Config mechanism to perform minimal updates to |
| 42 | // remain in sync. |
| 43 | func (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. |