1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Modal modes. The modeline chip is derived from these.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Mode {
Browse,
/// Incremental `/` filter on the focused pane.
Search,
/// Vim-style find-in-file over the preview (`␣ /`, plans/0007 §3).
Find,
/// A text input is focused; sub-mode lives on `VimInput`.
Insert,
Normal,
Leader,
/// Later phases (multi-select).
#[allow(dead_code)]
Visual,
/// File-history lens over the preview pane (plans/0016 M1b).
History,
/// The preview pane owns the keyboard (plans/0016 M1): line
/// cursor, find-in-file, history, blame.
Preview,
/// The commit viewer (plans/0028): commit detail + file deltas
/// over the preview pane, entered from the history lens.
Commit,
}
impl Mode {
pub fn chip(self) -> &'static str {
match self {
Mode::Browse => "BROWSE",
Mode::Search => "SEARCH",
Mode::Find => "FIND",
Mode::Insert => "INSERT",
Mode::Normal => "NORMAL",
Mode::Leader => "LEADER",
Mode::Visual => "VISUAL",
Mode::History => "HISTORY",
Mode::Preview => "PREVIEW",
Mode::Commit => "COMMIT",
}
}
}