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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//! Application-level actions dispatched from chord bindings.
//!
//! Each variant corresponds to one app-handled binding currently
//! in `event_loop.rs`. The enum is used as the action type for
//! `Keymap<AppAction>`.
/// Every action the app can perform in response to a chord binding.
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum AppAction {
// ── File / buffer pickers ──────────────────────────────────────────
OpenFilePicker,
OpenBufferPicker,
OpenGrepPicker,
// ── Git commands ───────────────────────────────────────────────────
GitStatus,
GitLog,
GitBranch,
GitFileHistory,
GitStashes,
GitTags,
GitRemotes,
// ── LSP ───────────────────────────────────────────────────────────
ShowDiagAtCursor,
LspCodeActions,
LspRename,
LspGotoDef,
LspGotoDecl,
LspGotoRef,
LspGotoImpl,
LspGotoTypeDef,
// ── Tab navigation ─────────────────────────────────────────────────
Tabnext,
Tabprev,
// ── Buffer navigation ──────────────────────────────────────────────
BufferNext,
BufferPrev,
// ── Diagnostic navigation ─────────────────────────────────────────
DiagNext,
DiagPrev,
DiagNextError,
DiagPrevError,
// ── Window focus ───────────────────────────────────────────────────
FocusLeft,
FocusBelow,
FocusAbove,
FocusRight,
FocusNext,
FocusPrev,
// ── Window management ─────────────────────────────────────────────
CloseFocusedWindow,
OnlyFocusedWindow,
SwapWithSibling,
MoveWindowToNewTab,
NewSplit,
// ── Window resize ─────────────────────────────────────────────────
/// Grow height by count (negative = shrink).
ResizeHeight(i32),
/// Grow width by count (negative = shrink).
ResizeWidth(i32),
EqualizeLayout,
MaximizeHeight,
MaximizeWidth,
// ── App lifecycle ─────────────────────────────────────────────────
QuitOrClose,
// ── User runtime maps (`:map` / `:noremap` family) ─────────────────
/// User-defined `:map` / `:noremap` runtime mapping. When the trie matches
/// the LHS, the dispatcher unrolls `keys` according to `recursive`:
/// - `recursive = true` → feed each key back through `dispatch_keymap_in_mode`
/// (the RHS can trigger further chord bindings).
/// - `recursive = false` → replay each key straight to the engine.
Replay {
keys: Vec<hjkl_keymap::KeyEvent>,
recursive: bool,
},
}