MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / insert

Method insert

atomic-core/src/change/ops.rs:636–647  ·  view source on GitHub ↗

Creates a line insert operation with leaf operations. # Arguments `branch_id` - The branch ID for this new line `after` - Insert after this branch ID (None = start of file) `leaf_ops` - The token operations for this line's content

(branch_id: BranchId, after: Option<BranchId>, leaf_ops: Vec<LeafOp>)

Source from the content-addressed store, hash-verified

634 /// * `after` - Insert after this branch ID (None = start of file)
635 /// * `leaf_ops` - The token operations for this line's content
636 pub fn insert(branch_id: BranchId, after: Option<BranchId>, leaf_ops: Vec<LeafOp>) -> Self {
637 Self {
638 branch_id,
639 operation: BranchOp::Insert {
640 after,
641 content: leaf_ops,
642 },
643 old_line_num: None,
644 new_line_num: None,
645 content_range: None,
646 }
647 }
648
649 /// Creates a line insert operation with line number.
650 pub fn insert_at(

Calls

no outgoing calls