pub struct LineStyle<'a> {
pub line: usize,
pub left_col: usize,
pub width: usize,
pub tab_width: usize,
pub selections: &'a [Selection],
pub primary: Selection,
pub cursor_line: bool,
pub brackets: Option<(Position, Position)>,
pub theme: &'a ThemeColors,
}Expand description
Everything needed to draw one visible line.
A struct rather than nine positional arguments: the call site was already at
six and the three effects added here would have made it a row of unlabelled
values where swapping two usizes compiles cleanly and renders wrong.
Fields§
§line: usize§left_col: usize§width: usizeText-area width in cells, for padding the current-line highlight out to the edge.
tab_width: usize§selections: &'a [Selection]§primary: Selection§cursor_line: boolWhether a caret sits on this line with nothing selected. A line carrying a real selection does not also get the stripe — the selection is already saying where the user is, and two answers to one question is how a interface starts to look busy.
brackets: Option<(Position, Position)>§theme: &'a ThemeColorsAuto Trait Implementations§
impl<'a> Freeze for LineStyle<'a>
impl<'a> RefUnwindSafe for LineStyle<'a>
impl<'a> Send for LineStyle<'a>
impl<'a> Sync for LineStyle<'a>
impl<'a> Unpin for LineStyle<'a>
impl<'a> UnsafeUnpin for LineStyle<'a>
impl<'a> UnwindSafe for LineStyle<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more