pub struct HeadlessLine {
pub logical_line_index: usize,
pub is_wrapped_part: bool,
pub visual_in_logical: usize,
pub char_offset_start: usize,
pub char_offset_end: usize,
pub segment_x_start_cells: usize,
pub is_fold_placeholder_appended: bool,
pub cells: Vec<Cell>,
}Expand description
Headless line information
Fields§
§logical_line_index: usizeCorresponding logical line index
is_wrapped_part: boolWhether this is a part created by wrapping (soft wrap)
visual_in_logical: usizeWhich wrapped segment within the logical line (0-based).
char_offset_start: usizeCharacter offset (inclusive) of this segment in the document.
char_offset_end: usizeCharacter offset (exclusive) of this segment in the document.
segment_x_start_cells: usizeRender x (in cells) where document text of this segment starts within the visual line.
For wrapped segments this is typically the wrap-indent cells.
is_fold_placeholder_appended: boolWhether a fold placeholder was appended to this segment.
cells: Vec<Cell>List of cells
Implementations§
Source§impl HeadlessLine
impl HeadlessLine
Sourcepub fn new(logical_line_index: usize, is_wrapped_part: bool) -> Self
pub fn new(logical_line_index: usize, is_wrapped_part: bool) -> Self
Create an empty headless line.
Sourcepub fn set_visual_metadata(
&mut self,
visual_in_logical: usize,
char_offset_start: usize,
char_offset_end: usize,
segment_x_start_cells: usize,
)
pub fn set_visual_metadata( &mut self, visual_in_logical: usize, char_offset_start: usize, char_offset_end: usize, segment_x_start_cells: usize, )
Fill visual segment metadata for this line.
Sourcepub fn set_fold_placeholder_appended(&mut self, appended: bool)
pub fn set_fold_placeholder_appended(&mut self, appended: bool)
Mark whether this line has fold placeholder text appended.
Sourcepub fn visual_width(&self) -> usize
pub fn visual_width(&self) -> usize
Get total visual width of this line
Trait Implementations§
Source§impl Clone for HeadlessLine
impl Clone for HeadlessLine
Auto Trait Implementations§
impl Forget for HeadlessLine
impl Freeze for HeadlessLine
impl Move for HeadlessLine
impl RefUnwindSafe for HeadlessLine
impl Send for HeadlessLinewhere
RawVecInner: Send,
impl Sync for HeadlessLinewhere
RawVecInner: Sync,
impl Unpin for HeadlessLine
impl UnsafeUnpin for HeadlessLine
impl UnwindSafe for HeadlessLinewhere
RawVecInner: UnwindSafe,
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