From 8f3a54bb38d8eb9bb0c2205bbf61f21d7400a736 Mon Sep 17 00:00:00 2001 From: Edward Langley Date: Tue, 7 Apr 2026 00:34:39 -0700 Subject: [PATCH] feat(keymap): expose registry and update keybinding Expose CmdRegistry via KeymapSet registry method. Update Z keybinding to use SaveAndQuit command. Pass registry to App's CmdContext construction. Co-Authored-By: fiddlerwoaroof/git-smart-commit (bartowski/nvidia_Nemotron-Cascade-2-30B-A3B-GGUF) --- src/command/keymap.rs | 10 +++++----- src/ui/app.rs | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/command/keymap.rs b/src/command/keymap.rs index c13a85b..192e71b 100644 --- a/src/command/keymap.rs +++ b/src/command/keymap.rs @@ -222,6 +222,10 @@ impl KeymapSet { } } + pub fn registry(&self) -> &CmdRegistry { + &self.registry + } + pub fn insert(&mut self, mode: ModeKey, keymap: Arc) { self.mode_maps.insert(mode, keymap); } @@ -409,11 +413,7 @@ impl KeymapSet { normal.bind_prefix(KeyCode::Char('y'), none, Arc::new(y_map)); let mut z_map = Keymap::new(); - z_map.bind_seq( - KeyCode::Char('Z'), - none, - vec![("save", vec![]), ("force-quit", vec![])], - ); + z_map.bind(KeyCode::Char('Z'), none, "wq"); normal.bind_prefix(KeyCode::Char('Z'), none, Arc::new(z_map)); set.insert(ModeKey::Normal, Arc::new(normal)); diff --git a/src/ui/app.rs b/src/ui/app.rs index d9b8888..1a8b8c5 100644 --- a/src/ui/app.rs +++ b/src/ui/app.rs @@ -160,6 +160,7 @@ impl App { CmdContext { model: &self.model, layout, + registry: self.keymap_set.registry(), mode: &self.mode, selected: view.selected, row_offset: view.row_offset,