chore: clippy + fmt
This commit is contained in:
@ -348,22 +348,34 @@ impl KeymapSet {
|
||||
fp.bind_cmd(
|
||||
KeyCode::Up,
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::Formula, delta: -1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::Formula,
|
||||
delta: -1,
|
||||
},
|
||||
);
|
||||
fp.bind_cmd(
|
||||
KeyCode::Char('k'),
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::Formula, delta: -1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::Formula,
|
||||
delta: -1,
|
||||
},
|
||||
);
|
||||
fp.bind_cmd(
|
||||
KeyCode::Down,
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::Formula, delta: 1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::Formula,
|
||||
delta: 1,
|
||||
},
|
||||
);
|
||||
fp.bind_cmd(
|
||||
KeyCode::Char('j'),
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::Formula, delta: 1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::Formula,
|
||||
delta: 1,
|
||||
},
|
||||
);
|
||||
fp.bind_cmd(KeyCode::Char('a'), none, cmd::EnterFormulaEdit);
|
||||
fp.bind_cmd(KeyCode::Char('n'), none, cmd::EnterFormulaEdit);
|
||||
@ -379,29 +391,43 @@ impl KeymapSet {
|
||||
cp.bind_cmd(
|
||||
KeyCode::Up,
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::Category, delta: -1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::Category,
|
||||
delta: -1,
|
||||
},
|
||||
);
|
||||
cp.bind_cmd(
|
||||
KeyCode::Char('k'),
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::Category, delta: -1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::Category,
|
||||
delta: -1,
|
||||
},
|
||||
);
|
||||
cp.bind_cmd(
|
||||
KeyCode::Down,
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::Category, delta: 1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::Category,
|
||||
delta: 1,
|
||||
},
|
||||
);
|
||||
cp.bind_cmd(
|
||||
KeyCode::Char('j'),
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::Category, delta: 1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::Category,
|
||||
delta: 1,
|
||||
},
|
||||
);
|
||||
cp.bind_cmd(KeyCode::Enter, none, cmd::CycleAxisAtCursor);
|
||||
cp.bind_cmd(KeyCode::Char(' '), none, cmd::CycleAxisAtCursor);
|
||||
cp.bind_cmd(
|
||||
KeyCode::Char('n'),
|
||||
none,
|
||||
cmd::EnterMode(AppMode::CategoryAdd { buffer: String::new() }),
|
||||
cmd::EnterMode(AppMode::CategoryAdd {
|
||||
buffer: String::new(),
|
||||
}),
|
||||
);
|
||||
cp.bind_cmd(KeyCode::Char('a'), none, cmd::OpenItemAddAtCursor);
|
||||
cp.bind_cmd(KeyCode::Char('o'), none, cmd::OpenItemAddAtCursor);
|
||||
@ -414,22 +440,34 @@ impl KeymapSet {
|
||||
vp.bind_cmd(
|
||||
KeyCode::Up,
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::View, delta: -1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::View,
|
||||
delta: -1,
|
||||
},
|
||||
);
|
||||
vp.bind_cmd(
|
||||
KeyCode::Char('k'),
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::View, delta: -1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::View,
|
||||
delta: -1,
|
||||
},
|
||||
);
|
||||
vp.bind_cmd(
|
||||
KeyCode::Down,
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::View, delta: 1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::View,
|
||||
delta: 1,
|
||||
},
|
||||
);
|
||||
vp.bind_cmd(
|
||||
KeyCode::Char('j'),
|
||||
none,
|
||||
cmd::MovePanelCursor { panel: crate::ui::effect::Panel::View, delta: 1 },
|
||||
cmd::MovePanelCursor {
|
||||
panel: crate::ui::effect::Panel::View,
|
||||
delta: 1,
|
||||
},
|
||||
);
|
||||
vp.bind_cmd(KeyCode::Enter, none, cmd::SwitchViewAtCursor);
|
||||
vp.bind_cmd(KeyCode::Char('n'), none, cmd::CreateAndSwitchView);
|
||||
@ -461,9 +499,13 @@ impl KeymapSet {
|
||||
ed.bind_cmd(
|
||||
KeyCode::Backspace,
|
||||
none,
|
||||
cmd::PopChar { buffer: "edit".to_string() },
|
||||
cmd::PopChar {
|
||||
buffer: "edit".to_string(),
|
||||
},
|
||||
);
|
||||
ed.bind_any_char(cmd::AppendChar { buffer: "edit".to_string() });
|
||||
ed.bind_any_char(cmd::AppendChar {
|
||||
buffer: "edit".to_string(),
|
||||
});
|
||||
set.insert(ModeKey::Editing, Arc::new(ed));
|
||||
|
||||
// ── Formula edit mode ────────────────────────────────────────────
|
||||
@ -473,9 +515,13 @@ impl KeymapSet {
|
||||
fe.bind_cmd(
|
||||
KeyCode::Backspace,
|
||||
none,
|
||||
cmd::PopChar { buffer: "formula".to_string() },
|
||||
cmd::PopChar {
|
||||
buffer: "formula".to_string(),
|
||||
},
|
||||
);
|
||||
fe.bind_any_char(cmd::AppendChar { buffer: "formula".to_string() });
|
||||
fe.bind_any_char(cmd::AppendChar {
|
||||
buffer: "formula".to_string(),
|
||||
});
|
||||
set.insert(ModeKey::FormulaEdit, Arc::new(fe));
|
||||
|
||||
// ── Category add mode ────────────────────────────────────────────
|
||||
@ -486,9 +532,13 @@ impl KeymapSet {
|
||||
ca.bind_cmd(
|
||||
KeyCode::Backspace,
|
||||
none,
|
||||
cmd::PopChar { buffer: "category".to_string() },
|
||||
cmd::PopChar {
|
||||
buffer: "category".to_string(),
|
||||
},
|
||||
);
|
||||
ca.bind_any_char(cmd::AppendChar { buffer: "category".to_string() });
|
||||
ca.bind_any_char(cmd::AppendChar {
|
||||
buffer: "category".to_string(),
|
||||
});
|
||||
set.insert(ModeKey::CategoryAdd, Arc::new(ca));
|
||||
|
||||
// ── Item add mode ────────────────────────────────────────────────
|
||||
@ -499,9 +549,13 @@ impl KeymapSet {
|
||||
ia.bind_cmd(
|
||||
KeyCode::Backspace,
|
||||
none,
|
||||
cmd::PopChar { buffer: "item".to_string() },
|
||||
cmd::PopChar {
|
||||
buffer: "item".to_string(),
|
||||
},
|
||||
);
|
||||
ia.bind_any_char(cmd::AppendChar { buffer: "item".to_string() });
|
||||
ia.bind_any_char(cmd::AppendChar {
|
||||
buffer: "item".to_string(),
|
||||
});
|
||||
set.insert(ModeKey::ItemAdd, Arc::new(ia));
|
||||
|
||||
// ── Export prompt mode ───────────────────────────────────────────
|
||||
@ -511,9 +565,13 @@ impl KeymapSet {
|
||||
ep.bind_cmd(
|
||||
KeyCode::Backspace,
|
||||
none,
|
||||
cmd::PopChar { buffer: "export".to_string() },
|
||||
cmd::PopChar {
|
||||
buffer: "export".to_string(),
|
||||
},
|
||||
);
|
||||
ep.bind_any_char(cmd::AppendChar { buffer: "export".to_string() });
|
||||
ep.bind_any_char(cmd::AppendChar {
|
||||
buffer: "export".to_string(),
|
||||
});
|
||||
set.insert(ModeKey::ExportPrompt, Arc::new(ep));
|
||||
|
||||
// ── Command mode ─────────────────────────────────────────────────
|
||||
@ -522,7 +580,9 @@ impl KeymapSet {
|
||||
// Enter → execute_command (still handled by old handler for now —
|
||||
// the complex execute_command logic isn't easily a single Cmd)
|
||||
cm.bind_cmd(KeyCode::Backspace, none, cmd::CommandModeBackspace);
|
||||
cm.bind_any_char(cmd::AppendChar { buffer: "command".to_string() });
|
||||
cm.bind_any_char(cmd::AppendChar {
|
||||
buffer: "command".to_string(),
|
||||
});
|
||||
set.insert(ModeKey::CommandMode, Arc::new(cm));
|
||||
|
||||
// ── Search mode ──────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user