gosuto 0.11.1

Gōsuto (ゴースト) — a cyberpunk terminal Matrix client with vim motions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crossterm::event::KeyEvent;

use super::command::handle_command;
use super::insert::handle_insert;
use super::normal::handle_normal;
use super::{InputResult, VimMode, VimState};

pub fn handle_key(key: KeyEvent, vim: &mut VimState) -> InputResult {
    match vim.mode {
        VimMode::Normal => handle_normal(key, vim),
        VimMode::Insert => handle_insert(key, vim),
        VimMode::Command => handle_command(key, vim),
    }
}