pub enum KeyContext {
Global,
Project,
Editor,
Agent,
Terminal,
}Expand description
Where a binding applies.
Phase 02 got away with a focus check inside the command handler, because nothing
competed for the arrow keys. The editor is the second consumer — Down means “next
tree row” in the explorer and “next line” in a buffer — so the choice belongs in
resolution, where one chord can mean different things in different panes, rather than
in a growing pile of if focus != ... guards.
Resolution tries the focused context first and falls back to KeyContext::Global,
so Ctrl+S keeps working everywhere while Enter is free to differ.
Variants§
Global
Applies regardless of focus.
Project
Only while the file explorer has focus.
Editor
Only while a buffer has focus.
Agent
Only while the agent pane has focus and a session exists.
Terminal
Only while terminal copy mode is active. Normal terminal input bypasses the keymap and is encoded directly for the PTY (ADR-0008 §3).
Trait Implementations§
Source§impl Clone for KeyContext
impl Clone for KeyContext
Source§fn clone(&self) -> KeyContext
fn clone(&self) -> KeyContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more