refactor(command): remove key_modifiers from CmdContext

Remove the key_modifiers field from CmdContext struct and all its usages.

This simplifies the command context by removing unused modifier state.
The Cmd trait's execute method no longer receives key modifiers.

Changes:
- Removed KeyModifiers import from cmd.rs
- Removed key_modifiers field from CmdContext struct
- Removed file_path_set field from CmdContext (unused)
- Updated App::cmd_context to not populate key_modifiers
- Removed KeymapSet::registry() accessor
- Updated test code to match new struct layout
- Added documentation to Cmd::name() method

Co-Authored-By: fiddlerwoaroof/git-smart-commit (unsloth/Qwen3.5-35B-A3B-GGUF:Q5_K_M)
This commit is contained in:
Edward Langley
2026-04-04 12:40:55 -07:00
parent c6c8ac2c69
commit e2ff9cf98e
3 changed files with 6 additions and 12 deletions

View File

@ -100,7 +100,7 @@ impl App {
}
}
pub fn cmd_context(&self, key: KeyCode, mods: KeyModifiers) -> CmdContext<'_> {
pub fn cmd_context(&self, key: KeyCode, _mods: KeyModifiers) -> CmdContext<'_> {
let view = self.model.active_view();
let layout = GridLayout::new(&self.model, view);
let (sel_row, sel_col) = view.selected;
@ -113,7 +113,6 @@ impl App {
search_query: &self.search_query,
yanked: &self.yanked,
dirty: self.dirty,
file_path_set: self.file_path.is_some(),
search_mode: self.search_mode,
formula_panel_open: self.formula_panel_open,
category_panel_open: self.category_panel_open,
@ -127,7 +126,6 @@ impl App {
row_count: layout.row_count(),
col_count: layout.col_count(),
key_code: key,
key_modifiers: mods,
}
}