pub struct Fold {
pub start_line: u32,
pub end_line: u32,
pub closed: bool,
pub identity: Option<u64>,
}Expand description
One contiguous fold range in a document buffer.
identity is the stable handle used to carry closed-state
across recomputes. Computed providers (indent / markdown) hash
the trimmed start-line text together with the leading-indent
depth so that adding or removing lines elsewhere in the buffer
doesn’t reopen this fold. Manual folds (zf) leave it None
– their stable identity is the line range itself.
Phase 5.2: moved from lattice-ui-tui::app::Fold to this
renderer-agnostic home. Existing crate::app::Fold call sites
continue to resolve via a pub use lattice_core::Fold;
re-export in lattice-ui-tui::app.
Fields§
§start_line: u32First line of the fold, 0-based. Stays visible when the fold is closed (it carries the summary).
end_line: u32Last line of the fold, 0-based and inclusive. Providers only emit
folds with end_line > start_line.
closed: boolWhether the fold is collapsed, hiding start_line + 1 ..= end_line.
identity: Option<u64>Stable identity used to carry closed across recomputes; None for
manual folds, whose identity is the line range. See the type docs.