Clipboard

Struct Clipboard 

Source
pub struct Clipboard { /* private fields */ }
Expand description

The builtin, internal clipboard of the editor.

This is useful particularly when the terminal doesn’t support OSC 52 or when the clipboard contents are huge (e.g. 1GiB).

Implementations§

Source§

impl Clipboard

Source

pub fn wants_host_sync(&self) -> bool

If true, we should emit a OSC 52 sequence to sync the clipboard with the hosting terminal.

Source

pub fn mark_as_synchronized(&mut self)

Call this once the clipboard has been synchronized with the host.

Source

pub fn is_line_copy(&self) -> bool

The editor has a special behavior when you have no selection and press Ctrl+C: It copies the current line to the clipboard. Then, when you paste it, it inserts the line at the start of the current line. This effectively prepends the current line with the copied line. clipboard_line_start is true in that case.

Source

pub fn read(&self) -> &[u8]

Returns the current contents of the clipboard.

Source

pub fn write(&mut self, data: Vec<u8>)

Fill the clipboard with the given data.

Source

pub fn write_was_line_copy(&mut self, line_copy: bool)

Trait Implementations§

Source§

impl Default for Clipboard

Source§

fn default() -> Clipboard

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

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.