Marks a line for deletion. Note: This creates a delete without content. For deletes with content (for diff display), use the `LineOps::delete()` constructor directly.
(&mut self, branch_id: BranchId)
| 275 | /// Note: This creates a delete without content. For deletes with content |
| 276 | /// (for diff display), use the `LineOps::delete()` constructor directly. |
| 277 | pub fn delete_line(&mut self, branch_id: BranchId) { |
| 278 | let line_op = LineOps::delete_empty(branch_id); |
| 279 | |
| 280 | // Find which file this branch belongs to |
| 281 | if let Some(&(file_idx, _)) = self.branch_index.get(&branch_id) { |
| 282 | self.file_ops[file_idx].add_line_op(line_op); |
| 283 | } else { |
| 284 | // Branch not in index - create a placeholder file op |
| 285 | use super::trunk::FileOps; |
| 286 | use crate::crdt::TrunkId; |
| 287 | use crate::types::NodeId; |
| 288 | |
| 289 | let file_op = FileOps::new(TrunkId::new(NodeId::new(0), 0), String::new(), None); |
| 290 | let mut file_op = file_op; |
| 291 | file_op.add_line_op(line_op); |
| 292 | self.file_ops.push(file_op); |
| 293 | } |
| 294 | |
| 295 | self.stats.lines_deleted += 1; |
| 296 | } |
| 297 | |
| 298 | /// Applies a line change from the analyzer. |
| 299 | /// |