pub struct CursorDisplay {
pub position: usize,
pub anchor: usize,
pub visible: bool,
}Expand description
Cursor display state for rendering.
The adapter reads cursor position from text-document’s TextCursor
and creates this struct to feed to [Typesetter::set_cursor].
text-typeset uses it to generate caret and selection decorations
in the next [Typesetter::render] call.
Fields§
§position: usizeCursor position (character offset in the document).
anchor: usizeSelection anchor. Equals position when there is no selection.
When different from position, the range [min(anchor, position), max(anchor, position))
is highlighted as a selection.
visible: boolWhether the caret is visible (false during the blink-off phase). The adapter manages the blink timer; text-typeset just respects this flag.
Auto Trait Implementations§
impl Freeze for CursorDisplay
impl RefUnwindSafe for CursorDisplay
impl Send for CursorDisplay
impl Sync for CursorDisplay
impl Unpin for CursorDisplay
impl UnsafeUnpin for CursorDisplay
impl UnwindSafe for CursorDisplay
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