pub struct Registers {
pub unnamed: Slot,
pub yank_zero: Slot,
pub delete_ring: [Slot; 9],
pub named: [Slot; 26],
pub clip: Slot,
}Fields§
§unnamed: Slot" — written by every yank / delete / change.
yank_zero: Slot"0 — last yank only.
delete_ring: [Slot; 9]"1–"9 — last 9 deletes ("1 newest).
named: [Slot; 26]"a–"z — named user registers.
clip: Slot"+ / "* — system clipboard register. Both selectors alias
the same slot (matches the typical Linux/macOS/Windows setup
where there’s no separate primary selection in our pipeline).
The host (the host) syncs this slot from the OS clipboard
before paste and from the slot back out on yank.
Implementations§
Source§impl Registers
impl Registers
Sourcepub fn record_yank(
&mut self,
text: String,
linewise: bool,
target: Option<char>,
)
pub fn record_yank( &mut self, text: String, linewise: bool, target: Option<char>, )
Record a yank operation. Writes to ", "0, and (if
target is set) the named slot.
Sourcepub fn record_delete(
&mut self,
text: String,
linewise: bool,
target: Option<char>,
)
pub fn record_delete( &mut self, text: String, linewise: bool, target: Option<char>, )
Record a delete / change. Writes to ", rotates the
"1–"9 ring, and (if target is set) the named slot.
Empty deletes are dropped — vim doesn’t pollute the ring
with no-ops.
Sourcepub fn read(&self, reg: char) -> Option<&Slot>
pub fn read(&self, reg: char) -> Option<&Slot>
Read a register by its single-char selector. Returns None
for unrecognised selectors.
Sourcepub fn set_clipboard(&mut self, text: String, linewise: bool)
pub fn set_clipboard(&mut self, text: String, linewise: bool)
Replace the clipboard slot’s contents — host hook for syncing
from the OS clipboard before a paste from "+ / "*.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Registers
impl<'de> Deserialize<'de> for Registers
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Registers
impl RefUnwindSafe for Registers
impl Send for Registers
impl Sync for Registers
impl Unpin for Registers
impl UnsafeUnpin for Registers
impl UnwindSafe for Registers
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more