Commit 86e091a1 authored by Matthew Nicholson's avatar Matthew Nicholson
Browse files

add support for setting vi or emacs key bindings in Context

parent b8c8661a
......@@ -39,10 +39,18 @@ pub fn get_buffer_words(buf: &Buffer) -> Vec<(usize, usize)> {
res
}
/// The key bindings to use.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum KeyBindings {
Vi,
Emacs,
}
pub struct Context {
pub history: History,
pub completer: Option<Box<Completer>>,
pub word_fn: Box<Fn(&Buffer) -> Vec<(usize, usize)>>,
pub key_bindings: KeyBindings,
}
impl Context {
......@@ -51,6 +59,7 @@ impl Context {
history: History::new(),
completer: None,
word_fn: Box::new(get_buffer_words),
key_bindings: KeyBindings::Emacs,
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment