docs/generated/contracts.mdgenerated from code
Reference · 1 min read
cursor
Contracts: cursor.
Read as
Source: crates/lvcs-doc/src/cursor/mod.rs.
1/// An inclusive range anchor (discussion:owner/156): `start` is the range's first2/// character and `end` its last, each the id of the op that inserted it,3/// both visible at the heads `at` it was made at. No anchor is empty. An4/// insert exactly at either boundary lands outside the range, because each5/// end is a character, not a gap.6#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]7pub struct RangeAnchor {8 /// The heads the anchor was made at, sorted.9 pub at: Heads,10 pub start: ChangeId,11 pub end: ChangeId,12}1314/// A [`RangeAnchor`] resolved at some heads.15#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]16pub enum AnchorSpan {17 /// The range is the code points `start..end` there (`start < end`):18 /// `start` is the first character's position or, once it is deleted,19 /// that of the next character visible there (discussion:owner/83); `end - 1`20 /// the same for the last character and the previous visible one.21 Range { start: usize, end: usize },22 /// Every character the range held is deleted there, and so is anything23 /// inserted inside it (discussion:owner/41). `at` is the gap where the range24 /// was, in code points at those heads (discussion:owner/92).25 Collapsed { at: usize },26}