Skip to main content

gpui_base/input/editor/display_map/
folding.rs

1/// A foldable line range supplied by an editor highlighter or another source.
2#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
3pub struct FoldRange {
4    pub start_line: usize,
5    pub end_line: usize,
6}
7
8impl FoldRange {
9    pub fn new(start_line: usize, end_line: usize) -> Self {
10        assert!(
11            start_line <= end_line,
12            "fold start_line must be <= end_line"
13        );
14        Self {
15            start_line,
16            end_line,
17        }
18    }
19}