#[repr(C)]pub struct SelectionOp {
pub direction: SelectionDirection,
pub step: SelectionStep,
pub mode: SelectionMode,
pub repeat: usize,
}Expand description
A unified selection operation that replaces all cursor movement, selection extension, and text deletion commands.
Every keyboard shortcut for cursor movement or deletion maps to this:
- Arrow Left = (Backward, Character, Move, 1)
- Shift+Right = (Forward, Character, Extend, 1)
- Ctrl+Backspace = (Backward, Word, Delete, 1)
- Home = (Backward, Line, Move, 1)
- Ctrl+End = (Forward, Document, Move, 1)
The repeat field enables vim-style commands: 3w = (Forward, Word, Move, 3).
Fields§
§direction: SelectionDirection§step: SelectionStep§mode: SelectionMode§repeat: usizeImplementations§
Source§impl SelectionOp
impl SelectionOp
pub fn new( direction: SelectionDirection, step: SelectionStep, mode: SelectionMode, ) -> Self
Trait Implementations§
Source§impl Clone for SelectionOp
impl Clone for SelectionOp
Source§fn clone(&self) -> SelectionOp
fn clone(&self) -> SelectionOp
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectionOp
impl Debug for SelectionOp
Source§impl Hash for SelectionOp
impl Hash for SelectionOp
Source§impl PartialEq for SelectionOp
impl PartialEq for SelectionOp
Source§fn eq(&self, other: &SelectionOp) -> bool
fn eq(&self, other: &SelectionOp) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for SelectionOp
impl Eq for SelectionOp
impl StructuralPartialEq for SelectionOp
Auto Trait Implementations§
impl Freeze for SelectionOp
impl RefUnwindSafe for SelectionOp
impl Send for SelectionOp
impl Sync for SelectionOp
impl Unpin for SelectionOp
impl UnsafeUnpin for SelectionOp
impl UnwindSafe for SelectionOp
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