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

Method insert

atomic-core/src/change/ops.rs:368–379  ·  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

366 /// * `after` - Insert after this branch ID (None = start of file)
367 /// * `leaf_ops` - The token operations for this line's content
368 pub fn insert(branch_id: BranchId, after: Option<BranchId>, leaf_ops: Vec<LeafOp>) -> Self {
369 Self {
370 branch_id,
371 operation: BranchOp::Insert {
372 after,
373 content: leaf_ops,
374 },
375 old_line_num: None,
376 new_line_num: None,
377 content_range: None,
378 }
379 }
380
381 /// Creates a line insert operation with line number.
382 pub fn insert_at(

Callers 4

serializeMethod · 0.45
collect_position_hashMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected