edamame 0.1.1

A fast TUI Markdown editor and viewer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crossterm::event::KeyEvent;

use crate::config::Action;
use crate::editor::EditorState;

pub mod default;
pub mod diff_keys;

/// A keybinding handler for an input mode. Implementations can inspect
/// the current `EditorState` (including mode) to return context-sensitive
/// `Action`s.
///
/// The default (non-modal) implementation lives in `default.rs`. A Vim
/// implementation is a deferred feature.
pub trait ModeHandler {
    fn handle(&mut self, event: KeyEvent, state: &EditorState) -> Option<Action>;
}