noop identical keys
All checks were successful
moparisthebest/rusty-keys/pipeline/head This commit looks good
All checks were successful
moparisthebest/rusty-keys/pipeline/head This commit looks good
This commit is contained in:
parent
d0e38d0e55
commit
527ab97a04
@ -149,8 +149,14 @@ impl<K, T, E, R> KeyMaps<K, T, E, R>
|
|||||||
let mut keymap = KeyMap::new();
|
let mut keymap = KeyMap::new();
|
||||||
let mut i: usize = 0;
|
let mut i: usize = 0;
|
||||||
for key_code in v {
|
for key_code in v {
|
||||||
// todo: if these are the same, do Noop instead
|
// if it's a direct key and it's the same, don't do any mapping
|
||||||
keymap.map(base_keymap[i], key_code);
|
if let Key::Direct(key) = key_code {
|
||||||
|
if base_keymap[i] != key {
|
||||||
|
keymap.map(base_keymap[i], key_code);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
keymap.map(base_keymap[i], key_code);
|
||||||
|
}
|
||||||
i = i + 1;
|
i = i + 1;
|
||||||
if i > base_keymap.len() {
|
if i > base_keymap.len() {
|
||||||
panic!("all keymaps must be the same length, keymap index 0 length: {}, index {} length: {},", base_keymap.len(), x, i);
|
panic!("all keymaps must be the same length, keymap index 0 length: {}, index {} length: {},", base_keymap.len(), x, i);
|
||||||
|
Loading…
Reference in New Issue
Block a user