#[non_exhaustive]pub enum MoveType {
Show 22 variants
BufferPos(MovePosition),
BufferByteOffset,
BufferLineOffset,
BufferLinePercent,
Column(MoveDir1D, bool),
FinalNonBlank(MoveDir1D),
FirstWord(MoveDir1D),
ItemMatch,
Line(MoveDir1D),
LineColumnOffset,
LinePercent,
LinePos(MovePosition),
WordBegin(WordStyle, MoveDir1D),
WordEnd(WordStyle, MoveDir1D),
ParagraphBegin(MoveDir1D),
SentenceBegin(MoveDir1D),
SectionBegin(MoveDir1D),
SectionEnd(MoveDir1D),
ScreenFirstWord(MoveDir1D),
ScreenLine(MoveDir1D),
ScreenLinePos(MovePosition),
ViewportPos(MovePosition),
}
Expand description
Specify a movement away from the current cursor position.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BufferPos(MovePosition)
Move to a line at a position relative to the buffer.
BufferByteOffset
Move to the column n bytes into the buffer.
BufferLineOffset
Move to the nth line in the buffer.
BufferLinePercent
Move to the line n% of the way through the buffer.
Column(MoveDir1D, bool)
Move to the previous or next column n times.
The bool parameter indicates whether to cross line boundaries.
FinalNonBlank(MoveDir1D)
FirstWord(MoveDir1D)
ItemMatch
Move to the matching character of the next item.
Items are characters like (
/)
, [
/]
, {
/}
, and so on.
Line(MoveDir1D)
LineColumnOffset
Move to the nth column in the current line.
LinePercent
Move to the column n% of the way through the current line.
LinePos(MovePosition)
Move to a column at a position relative to the current line.
WordBegin(WordStyle, MoveDir1D)
WordEnd(WordStyle, MoveDir1D)
ParagraphBegin(MoveDir1D)
SentenceBegin(MoveDir1D)
SectionBegin(MoveDir1D)
SectionEnd(MoveDir1D)
ScreenFirstWord(MoveDir1D)
ScreenLine(MoveDir1D)
Move n screen lines in MoveDir1D direction.
ScreenLinePos(MovePosition)
Move to a column at a position relative to the current screen line.
ViewportPos(MovePosition)
Move to the first word of the line displayed at a position relative to the viewport.
Implementations§
source§impl MoveType
impl MoveType
sourcepub fn is_inclusive_motion(&self) -> bool
pub fn is_inclusive_motion(&self) -> bool
Returns true
if this is an inclusive motion.
sourcepub fn is_jumping(&self) -> bool
pub fn is_jumping(&self) -> bool
Returns true
if this is a motion that causes cursor positions to be saved to
PositionList::JumpList.
sourcepub fn shape(&self) -> TargetShape
pub fn shape(&self) -> TargetShape
Returns the shape of the text selected by this movement when editing.
Trait Implementations§
source§impl From<MoveType> for EditTarget
impl From<MoveType> for EditTarget
source§impl PartialEq for MoveType
impl PartialEq for MoveType
impl Eq for MoveType
impl StructuralPartialEq for MoveType
Auto Trait Implementations§
impl Freeze for MoveType
impl RefUnwindSafe for MoveType
impl Send for MoveType
impl Sync for MoveType
impl Unpin for MoveType
impl UnwindSafe for MoveType
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
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>
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>
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)
&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)
&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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.