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
Source§fn clone(&self) -> HeadlessLine
fn clone(&self) -> HeadlessLine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HeadlessLine
impl RefUnwindSafe for HeadlessLine
impl Send for HeadlessLine
impl Sync for HeadlessLine
impl Unpin for HeadlessLine
impl UnsafeUnpin for HeadlessLine
impl UnwindSafe for HeadlessLine
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