Implement the authenticated structured entry viewer
This commit is contained in:
1 parent
57a79b7d21
commit
cf7a6216ac
8 files changed
+758
-28
No files matched your search
+58
-2
@@ -27,6 +27,12 @@ pub enum Action {
|
||||
PreviousMatch,
|
||||
FocusNext,
|
||||
FocusPrevious,
|
||||
Reveal,
|
||||
Hide,
|
||||
Copy,
|
||||
ScrollDown,
|
||||
ScrollUp,
|
||||
CloseEntry,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
@@ -222,18 +228,68 @@ pub static ACTIONS: &[ActionSpec] = &[
|
||||
},
|
||||
ActionSpec {
|
||||
action: Action::FocusNext,
|
||||
label: "next pane",
|
||||
label: "next field/pane",
|
||||
command: "focus-next",
|
||||
bindings: keys!((KeyCode::Tab, KeyModifiers::NONE, "Tab")),
|
||||
modes: UNLOCKED,
|
||||
},
|
||||
ActionSpec {
|
||||
action: Action::FocusPrevious,
|
||||
label: "previous pane",
|
||||
label: "previous field/pane",
|
||||
command: "focus-previous",
|
||||
bindings: keys!((KeyCode::BackTab, KeyModifiers::SHIFT, "S-Tab")),
|
||||
modes: UNLOCKED,
|
||||
},
|
||||
ActionSpec {
|
||||
action: Action::Reveal,
|
||||
label: "reveal field",
|
||||
command: "reveal",
|
||||
bindings: keys!((KeyCode::Char('v'), KeyModifiers::NONE, "v")),
|
||||
modes: &[Mode::Viewer],
|
||||
},
|
||||
ActionSpec {
|
||||
action: Action::Hide,
|
||||
label: "hide field",
|
||||
command: "hide",
|
||||
bindings: keys!((KeyCode::Char('V'), KeyModifiers::SHIFT, "V")),
|
||||
modes: &[Mode::Viewer],
|
||||
},
|
||||
ActionSpec {
|
||||
action: Action::Copy,
|
||||
label: "copy field",
|
||||
command: "copy",
|
||||
bindings: keys!((KeyCode::Char('y'), KeyModifiers::NONE, "y")),
|
||||
modes: &[Mode::Viewer],
|
||||
},
|
||||
ActionSpec {
|
||||
action: Action::ScrollDown,
|
||||
label: "scroll down",
|
||||
command: "scroll-down",
|
||||
bindings: keys!(
|
||||
(KeyCode::Char('j'), KeyModifiers::NONE, "j"),
|
||||
(KeyCode::Down, KeyModifiers::NONE, "↓"),
|
||||
(KeyCode::PageDown, KeyModifiers::NONE, "PgDn"),
|
||||
),
|
||||
modes: &[Mode::Viewer],
|
||||
},
|
||||
ActionSpec {
|
||||
action: Action::ScrollUp,
|
||||
label: "scroll up",
|
||||
command: "scroll-up",
|
||||
bindings: keys!(
|
||||
(KeyCode::Char('k'), KeyModifiers::NONE, "k"),
|
||||
(KeyCode::Up, KeyModifiers::NONE, "↑"),
|
||||
(KeyCode::PageUp, KeyModifiers::NONE, "PgUp"),
|
||||
),
|
||||
modes: &[Mode::Viewer],
|
||||
},
|
||||
ActionSpec {
|
||||
action: Action::CloseEntry,
|
||||
label: "close entry",
|
||||
command: "close-entry",
|
||||
bindings: keys!((KeyCode::Esc, KeyModifiers::NONE, "Esc")),
|
||||
modes: &[Mode::Viewer],
|
||||
},
|
||||
];
|
||||
|
||||
pub fn resolve_key(mode: Mode, code: KeyCode, modifiers: KeyModifiers) -> Option<Action> {
|
||||
|
||||
Reference in new issue
Block a user