pub struct Fold {
pub start_row: usize,
pub end_row: usize,
pub closed: bool,
pub auto_generated: bool,
}Expand description
A contiguous range of rows that the host can collapse to a single fold-marker line.
Folds are row-range spans: [start_row, end_row] inclusive. The buffer
never elides content — [crate::Buffer::lines] always returns the full
logical text regardless of fold state. It is the host’s render path that
skips hidden rows and replaces them with a stub.
See the folds module documentation for the full invariant description.
Fields§
§start_row: usizeFirst row of the folded range (visible when closed).
end_row: usizeLast row of the folded range, inclusive.
closed: booltrue = collapsed (rows after start_row are hidden).
auto_generated: booltrue when this fold was created by the auto-fold engine
(tree-sitter foldmethod=expr). Manual folds created via zf /
crate::Buffer::add_fold set this to false.
Used by crate::Buffer::set_auto_folds to distinguish auto
folds (which it manages) from manual folds (which it leaves
untouched).