pub struct VPoint { /* private fields */ }Expand description
A visual Point, which includes more information
Alongside the byte, char, and line of the Point, this
struct has:
- Number of
chars from the left edge - Number of visual cells from the left edge
- Desired number of visual cells from the left edge
- Number of wrapped cells from the left edge
- Desired number of wrapped cells from the left edge
The difference between visual cells and wrapped cells is that
visual cells are essentially “The distance a Point would
be if this line were not wrapped”
Desired cells are used when moving vertically, since when you
move a Selection up or down to a shorter line, then to a
longer one, you expect the horizontal position to hold. This
is applied both in full line and wrapped line vertical
movement.
Implementations§
Source§impl VPoint
impl VPoint
Sourcepub fn visual_col(&self) -> usize
pub fn visual_col(&self) -> usize
Total space from the start of the line
Sourcepub fn desired_visual_col(&self) -> usize
pub fn desired_visual_col(&self) -> usize
How much space there should be from the start of the line
Sourcepub fn wrapped_col(&self) -> usize
pub fn wrapped_col(&self) -> usize
Total space from the left edge
Sourcepub fn desired_wrapped_col(&self) -> usize
pub fn desired_wrapped_col(&self) -> usize
How much space there should be from the left edge
Trait Implementations§
Source§impl<'__de, __Context> BorrowDecode<'__de, __Context> for VPoint
impl<'__de, __Context> BorrowDecode<'__de, __Context> for VPoint
Source§fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>(
decoder: &mut __D,
) -> Result<Self, DecodeError>
fn borrow_decode<__D: BorrowDecoder<'__de, Context = __Context>>( decoder: &mut __D, ) -> Result<Self, DecodeError>
Attempt to decode this type with the given BorrowDecode.
Source§impl Ord for VPoint
impl Ord for VPoint
Source§impl PartialOrd for VPoint
impl PartialOrd for VPoint
impl Copy for VPoint
impl Eq for VPoint
Auto Trait Implementations§
impl Freeze for VPoint
impl RefUnwindSafe for VPoint
impl Send for VPoint
impl Sync for VPoint
impl Unpin for VPoint
impl UnwindSafe for VPoint
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.