@@ -64,10 +64,11 @@ macro_rules! keymap {
66 let _key = $key.parse::<::helix_view::input::KeyEvent>().unwrap();
66 let _key = $key.parse::<::helix_view::input::KeyEvent>().unwrap();
67− _map.insert(
67+ let _duplicate = _map.insert(
69 keymap!(@trie $value)
69 keymap!(@trie $value)
71+ debug_assert!(_duplicate.is_none(), "Duplicate key found: {:?}", _duplicate.unwrap());
71 _order.push(_key);
72 _order.push(_key);
@@ -691,6 +692,22 @@ pub fn merge_keys(mut config: Config) -> Config {
691#[cfg(test)]
692#[cfg(test)]
692mod tests {
693mod tests {
693 use super::*;
694 use super::*;
698+ fn duplicate_keys_should_panic() {
699+ keymap!({ "Normal mode"
701+ "i" => goto_definition,
706+ fn check_duplicate_keys_in_default_keymap() {
707+ // will panic on duplicate keys, assumes that `Keymaps` uses keymap! macro
695 fn merge_partial_keys() {
712 fn merge_partial_keys() {
696 let config = Config {
713 let config = Config {