pub enum EditOp {
Show 20 variants
Insert(String),
InsertNewline,
Backdelete,
Delete,
MoveLeft {
select: bool,
},
MoveRight {
select: bool,
},
MoveUp {
select: bool,
},
MoveDown {
select: bool,
},
MoveWordLeft {
select: bool,
},
MoveWordRight {
select: bool,
},
Home {
select: bool,
},
End {
select: bool,
},
SelectAll,
CollapseSelection,
MoveToPoint {
x: f32,
y: f32,
select: bool,
},
SelectWordAtPoint {
x: f32,
y: f32,
},
Compose {
text: String,
cursor: Option<(usize, usize)>,
},
FinishCompose,
ClearCompose,
ApplyEditingState(EditingStateBytes),
}Expand description
A single editing command applied to a TextEditor.
Movement variants carry a select flag: false moves the caret
(collapsing any selection), true extends the selection to the new
position (parley’s move_*/select_* twins).
Variants§
Insert(String)
Insert text, replacing the current selection.
InsertNewline
Insert a literal newline ('\n'), replacing the current selection.
Only meaningful in wrapped multi-line mode (see
TextEditor::set_wrap_width); a single-line field routes Enter to
submit instead of emitting this op.
Backdelete
Delete the grapheme before the caret (Backspace), or the selection.
Delete
Delete the grapheme after the caret (Delete/Forward-delete), or the selection.
MoveLeft
Move/extend one grapheme left (visual order).
MoveRight
Move/extend one grapheme right (visual order).
MoveUp
Move/extend one line up.
MoveDown
Move/extend one line down.
MoveWordLeft
Move/extend one word left.
MoveWordRight
Move/extend one word right.
Home
Move/extend to the start of the line (Home).
End
Move/extend to the end of the line (End).
SelectAll
Select the whole buffer.
CollapseSelection
Collapse the selection to its focus (drop the anchor).
MoveToPoint
Move the caret to (or extend the selection to) a layout-local point.
SelectWordAtPoint
Select the word under a layout-local point (double-click / long-press).
Compose
Begin/update an IME preedit with text and an optional caret range
(byte offsets within text). Desktop/winit composition path.
FinishCompose
Commit the current IME preedit into the buffer. Desktop/winit path.
ClearCompose
Discard the current IME preedit. Desktop/winit path.
ApplyEditingState(EditingStateBytes)
Replace the whole editing value from a platform mirror (Android/iOS
state-sync path). Byte offsets; see EditingStateBytes.
Trait Implementations§
impl StructuralPartialEq for EditOp
Auto Trait Implementations§
impl Freeze for EditOp
impl RefUnwindSafe for EditOp
impl Send for EditOp
impl Sync for EditOp
impl Unpin for EditOp
impl UnsafeUnpin for EditOp
impl UnwindSafe for EditOp
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,
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.