Trait rustyline::ConditionalEventHandler
source · pub trait ConditionalEventHandler: Send + Sync {
// Required method
fn handle(
&self,
evt: &Event,
n: RepeatCount,
positive: bool,
ctx: &EventContext<'_>,
) -> Option<Cmd>;
}
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§
sourcefn handle(
&self,
evt: &Event,
n: RepeatCount,
positive: bool,
ctx: &EventContext<'_>,
) -> Option<Cmd>
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.