pub struct FoldState { /* private fields */ }Expand description
Which fold starts are collapsed. Owned by the editor view; row ranges come from the highlighter per document version.
Implementations§
Source§impl FoldState
impl FoldState
Sourcepub fn toggle(&mut self, start_row: usize) -> bool
pub fn toggle(&mut self, start_row: usize) -> bool
Toggles the fold starting at start_row, returning true when the fold
ends up collapsed. Toggling a row that starts no range still flips
membership so a later recompute revealing a fold there picks it up.
Sourcepub fn is_collapsed(&self, start_row: usize) -> bool
pub fn is_collapsed(&self, start_row: usize) -> bool
Reports whether the fold starting at start_row is collapsed.
Sourcepub fn retain(&mut self, ranges: &[FoldRange])
pub fn retain(&mut self, ranges: &[FoldRange])
Drops collapsed starts absent from ranges, keeping the set aligned
with structural edits that move or delete fold headers.
Returns the collapsed range hiding row, if any. Ranges must be
sorted by start row; headers themselves are never hidden.
Reports whether row hides inside a collapsed range.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FoldState
impl RefUnwindSafe for FoldState
impl Send for FoldState
impl Sync for FoldState
impl Unpin for FoldState
impl UnsafeUnpin for FoldState
impl UnwindSafe for FoldState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more