@@ -12,8 +12,8 @@ static NEXT_VERSION: AtomicU64 = AtomicU64::new(1);
1212use crate :: highlight:: { HighlightSpan , Highlighter } ;
1313use crate :: inline:: { StyledRegion , extract_all_inline_styles, styles_in_range} ;
1414use crate :: marker:: {
15- HeadingInfo , LineMarkers , ParsedNodes , collect_node_infos , is_line_in_checked_task ,
16- is_line_in_code_block, markers_at_from_infos,
15+ HeadingInfo , LineMarkers , ListItemInfo , ParsedNodes , collect_node_infos ,
16+ is_line_in_checked_task , is_line_in_code_block, markers_at_from_infos,
1717} ;
1818use crate :: parser:: { MarkdownParser , MarkdownTree } ;
1919use crate :: table:: { RowKind , TableInfo } ;
@@ -674,6 +674,12 @@ impl BufferContent {
674674 & self . parsed ( ) . headings
675675 }
676676
677+ /// List items in document order (parent before child), for list folding.
678+ /// Rc-cached with the parse tree, so auto-invalidated on edit.
679+ pub fn list_items ( & self ) -> & [ ListItemInfo ] {
680+ & self . parsed ( ) . list_items
681+ }
682+
677683 /// Compute LineMarkers for a specific line on demand.
678684 pub fn line_markers ( & self , line_idx : usize ) -> LineMarkers {
679685 line_markers_from ( & self . parsed , & self . text , line_idx)
0 commit comments