pub trait ConditionalEventHandler: Send + Sync {
    fn handle(
&self,
evt: &Event,
n: RepeatCount,
positive: bool,
ctx: &EventContext<'_>
) -> Option<Cmd>; }
Available on crate feature custom-bindings only.
Expand description

May behave differently depending on:

  • edit mode (emacs vs vi)
  • vi input mode (insert vs replace vs command modes)
  • empty line
  • cursor position
  • repeat count
  • original key pressed (when same command is bound to different key)
  • hint

Required Methods§

source

fn handle(
&self,
evt: &Event,
n: RepeatCount,
positive: bool,
ctx: &EventContext<'_>
) -> Option<Cmd>

Takes the current input state and returns the command to be performed or None to perform the default one.

Implementors§