EditContextBuilder

Struct EditContextBuilder 

Source
pub struct EditContextBuilder(/* private fields */);
Expand description

Build a new EditContext.

Implementations§

Source§

impl EditContextBuilder

Source

pub fn build(self) -> EditContext

Finish building the EditContext.

Source

pub fn cursor_end(self, v: CursorEnd) -> Self

Set the CursorEnd.

Defaults to CursorEnd::Auto.

Source

pub fn target_shape(self, v: Option<TargetShape>) -> Self

Set the TargetShape.

Defaults to None.

Source

pub fn insert_style(self, v: Option<InsertStyle>) -> Self

Set the InsertStyle.

Defaults to None.

Source

pub fn last_column(self, v: bool) -> Self

Set whether it’s okay to move the cursor into the last column.

Defaults to true.

Source

pub fn register(self, v: Option<Register>) -> Self

Set the Register.

Defaults to None.

Source

pub fn register_append(self, v: bool) -> Self

Set whether this operation should append contents to the register or replace the existing ones.

Defaults to false.

Source

pub fn search_regex_dir(self, v: MoveDir1D) -> Self

Set the direction the regular expression should search in.

Defaults to MoveDir1D::Next.

Source

pub fn search_char(self, v: Option<(MoveDir1D, bool, Char)>) -> Self

Set a character to search for.

Defaults to None.

Source

pub fn replace_char(self, v: Option<Char>) -> Self

Set a Char to replace existing characters with.

Defaults to None.

Source

pub fn search_incremental(self, v: bool) -> Self

Set whether we should do an incremental search.

Defaults to false.

Source

pub fn mark(self, mark: Option<Mark>) -> Self

Set the contextual Mark.

Defaults to None.

Source

pub fn typed_char(self, ch: Option<Char>) -> Self

Set the contextual Mark.

Defaults to None.

Source

pub fn operation(self, op: EditAction) -> Self

Set the contextual Mark.

Defaults to EditAction::Motion.

Source

pub fn count(self, n: Option<usize>) -> Self

Set the contextual count.

Defaults to None.

Trait Implementations§

Source§

impl Default for EditContextBuilder

Source§

fn default() -> EditContextBuilder

Returns the “default value” for a type. Read more
Source§

impl From<EditContext> for EditContextBuilder

Source§

fn from(ctx: EditContext) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.