pub enum PasteStyle {
Cursor,
Side(MoveDir1D),
Replace,
}Expand description
Specify how to insert register contents into a buffer.
Variants§
Cursor
Paste text before the cursor.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, InsertTextAction};
let style = PasteStyle::Cursor;
let paste: Action = action!("insert paste -s cursor");
assert_eq!(paste, InsertTextAction::Paste(style, Count::Contextual).into());Side(MoveDir1D)
Paste text before the selection’s start, or after its end.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, InsertTextAction};
let style = PasteStyle::Side(MoveDir1D::Next);
let paste: Action = action!("insert paste -s (side -d next)");
assert_eq!(paste, InsertTextAction::Paste(style, Count::Contextual).into());
let style = PasteStyle::Side(MoveDir1D::Previous);
let paste: Action = action!("insert paste -s (side -d prev)");
assert_eq!(paste, InsertTextAction::Paste(style, Count::Contextual).into());Replace
Replace selected text with register contents.
§Example: Using action!
use editor_types::prelude::*;
use editor_types::{action, Action, InsertTextAction};
let style = PasteStyle::Replace;
let paste: Action = action!("insert paste -s replace");
assert_eq!(paste, InsertTextAction::Paste(style, Count::Contextual).into());Trait Implementations§
Source§impl Clone for PasteStyle
impl Clone for PasteStyle
Source§fn clone(&self) -> PasteStyle
fn clone(&self) -> PasteStyle
Returns a duplicate of the value. Read more
1.0.0 · 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 PasteStyle
impl Debug for PasteStyle
Source§impl PartialEq for PasteStyle
impl PartialEq for PasteStyle
impl Eq for PasteStyle
impl StructuralPartialEq for PasteStyle
Auto Trait Implementations§
impl Freeze for PasteStyle
impl RefUnwindSafe for PasteStyle
impl Send for PasteStyle
impl Sync for PasteStyle
impl Unpin for PasteStyle
impl UnwindSafe for PasteStyle
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