Repository navigation
refactor: centralize matches_key in keybindings and make char matching case-insensitive - #44
Conversation
…g case-insensitive
|
Confidence: 4.5/5Mechanical dedupe of 12 identical helpers into one. The only behavior change is the global helper gaining tree.rs's SHIFT-strip for punctuation plus ASCII case-folding. I merged it with current main, built it and ran it. SummaryThanks Felipe, nice cleanup. Removing the 12 copy-pasted
Mapflowchart LR
KB[config/keybindings.rs matches_key + parse_key]
CM[config/mod.rs re-export]
GM[gui/mod.rs global keys]
TR[controller/tree.rs pub use]
C[controller/*.rs 11 files]
KB --> CM
CM --> GM
CM --> C
CM --> TR
TR --> C
Start at Regressions
MigrationsNone. No config or keybinding format changes; same binding strings. Before merging
|
Description
Centralizes the duplicated
matches_keyimplementations across all controller modules into a single function insrc/config/keybindings.rs, while adding case-insensitive matching for character keys and normalizing shifted punctuation.Details
fn matches_keyacross controllers (branches,commits,commit_files,diff_mode,files,reflog,remote_branches,remotes,stash,status,tree, andgui/mod.rs), reducing code by 59 lines net.Ctrl+LvsCtrl+l), preventing ignored shortcuts.<or>) withKeyModifiers::SHIFT.Drequires Shift whereasddoes not).Validation
cargo test --bin lazygitrs(all 372 tests passed)cargo fmt --check