pub struct Keymap { /* private fields */ }Expand description
Input policy for one editor, holding a pending word between keys, see the crate docs for the contract.
Implementations§
Source§impl Keymap
impl Keymap
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Forget the pending word and last character, call it whenever the caret moves outside the keymap.
Sourcepub fn set_suffix_matching(&mut self, on: bool)
pub fn set_suffix_matching(&mut self, on: bool)
Whether space converts the longest known suffix of the pending word, on by default.
Sourcepub fn set_autocorrect(&mut self, on: bool)
pub fn set_autocorrect(&mut self, on: bool)
Whether two character sequences such as <= become symbols, on by default.
Sourcepub fn define_word(
&mut self,
word: &str,
label: &str,
commands: Vec<Command>,
) -> Result<(), InvalidWord>
pub fn define_word( &mut self, word: &str, label: &str, commands: Vec<Command>, ) -> Result<(), InvalidWord>
Register or replace a word shortcut, which lists after the ones defined before it.
Sourcepub fn undefine_word(&mut self, word: &str)
pub fn undefine_word(&mut self, word: &str)
Remove a word shortcut defined by the host, built in words stay.
Sourcepub fn entries(&self) -> Vec<KeymapEntry<'_>>
pub fn entries(&self) -> Vec<KeymapEntry<'_>>
Every word, host words in definition order and then the catalog in its fixed order.
Sourcepub fn commands_for_word(&self, word: &str) -> Option<Vec<Command>>
pub fn commands_for_word(&self, word: &str) -> Option<Vec<Command>>
The commands a word inserts, for a host rendered palette.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Keymap
impl RefUnwindSafe for Keymap
impl Send for Keymap
impl Sync for Keymap
impl Unpin for Keymap
impl UnsafeUnpin for Keymap
impl UnwindSafe for Keymap
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