pub struct BodyHit {
pub zone: PaneHitZone,
pub row_offset: u16,
pub text_col: Option<u16>,
pub origin: Option<RowOrigin>,
}Expand description
A screen cell resolved against the painted layout.
Still in display space: row_offset counts painted rows, which
under soft wrap or a closed fold is not a source line, and text_col
counts display columns, which inlays and conceals shift away from
source positions. Turning those into a buffer position is the
renderer’s next step, and it does it by inverting the same forward
maps the caret is drawn with — see docs/dev/architecture/mouse.md.
Fields§
§zone: PaneHitZone§row_offset: u16Rows below the top of the pane’s content area.
text_col: Option<u16>Display columns right of the first text cell, or None when the
cell is on the gutter.
origin: Option<RowOrigin>Which logical line (and wrap segment) this row was painted from.
None when the pane recorded no rows at all — a pane composed
before this frame’s paint, or one whose content path does not go
through the shared composer.
Implementations§
Source§impl BodyHit
impl BodyHit
Sourcepub fn logical_col(&self, body_width: u32) -> Option<u32>
pub fn logical_col(&self, body_width: u32) -> Option<u32>
The display column within the LOGICAL line, undoing soft wrap and horizontal scroll.
None on the gutter or on a row with no source line. The two
terms are exclusive in practice — leftcol is forced to 0 under
wrap — so adding both is correct rather than merely convenient.
Trait Implementations§
impl Copy for BodyHit
impl Eq for BodyHit
impl StructuralPartialEq for BodyHit
Auto Trait Implementations§
impl Freeze for BodyHit
impl RefUnwindSafe for BodyHit
impl Send for BodyHit
impl Sync for BodyHit
impl Unpin for BodyHit
impl UnsafeUnpin for BodyHit
impl UnwindSafe for BodyHit
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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