pub enum LineOp {
Split {
at: usize,
},
Join {
line: usize,
},
SetKind {
line: usize,
kind: LineKind,
},
SetContainers {
line: usize,
containers: Vec<Container>,
},
SetContinues {
line: usize,
continues: bool,
},
}Expand description
A line/block edit. Split/join splice \n in text; set ops touch metadata
only.
Variants§
Split
Paragraph break at at: insert \n and split the line metadata.
Join
Join line line with the next — remove the \n between them.
SetKind
Replace a line’s block role.
SetContainers
Replace a line’s container path.
SetContinues
Set (or clear) a line’s continues flag — whether it continues the
previous line’s block across a within-block hard break (a markdown hard
break, a code fence’s interior line) rather than starting a new block.
The op-grained twin of the value that install already round-trips:
split/join/text-delta \n insertion all mint continues: false
lines, so without this a hard break or a new code-fence interior line is
unreachable op-wise and falls back to a whole-install (losing that
edit’s identity anchors). Setting continues: true on line 0 is
ApplyError::FirstLineContinues (nothing precedes it to continue).